Results 1 to 4 of 4

Thread: Problem with ws-security with payload caching disabled

  1. #1
    Join Date
    Mar 2008
    Posts
    11

    Default Problem with ws-security with payload caching disabled

    Hello,

    I have a problem when using payloadcaching=false with axiom and a simple
    ws-security config:

    <bean id="securityRequestInterceptor"
    class="org.springframework.ws.soap.security.wss4j. Wss4jSecurityInterceptor">
    <property name="validationActions" value="UsernameToken"/>
    <property name="validationCallbackHandler" ref="requestCallbackHandler"/>
    </bean>

    <bean name="requestCallbackHandler"
    class="org.springframework.ws.soap.security.wss4j. callback.SimplePasswordValidationCallbackHandler">
    <property name="users">
    <props>
    <prop key="titi">toto</prop>
    </props>
    </property>
    </bean>

    <bean class="org.springframework.ws.server.endpoint.mapp ing.PayloadRootAnnotationMethodEndpointMapping">
    <description>
    </description>
    <property name="interceptors">
    <list>

    <ref bean="securityRequestInterceptor" />

    </list>
    </property>
    <property name="order" value="1" />
    </bean>

    <bean id="messageFactory" class="org.springframework.ws.soap.axiom.AxiomSoap MessageFactory">
    <property name="payloadCaching" value="false" />
    <property name="soapVersion">
    <util:constant static-field="org.springframework.ws.soap.SoapVersion.SOA P_11" />
    </property>
    </bean>

    The response i obtain is the following
    ...
    <faultstring xmlns="..." xml:lang="en">Error in converting SOAP Envelope to Document</faultstring>...

    if i enable payloadcaching it works fine

    I'am using spring ws v1.5.0

    Thanks in advance

  2. #2

    Default

    I think this is normal. From setPayloadCaching javadoc:
    Setting this to false will increase performance, but also result in the fact that the message payload can only be read once.
    This means when you disable payload caching, you can't add interceptors that read the header such as the Wss4jSecurityInterceptor.
    Tareq Abedrabbo

    My Twitter
    My Blog

  3. #3
    Join Date
    Mar 2008
    Posts
    11

    Default

    I think it should be possible to disable payload caching as the securityInterceptor is only interested in soap header and not in soap body.
    This feature is important for me as activating payloadcaching decreseases performance ,disables Stax streaming and stores the message in memory.
    I have also out of memories with large Soap Messages.
    See
    thread 49586 and 50967
    for soap message streaming issues.

    I don't know if it is possible to store only the soap header in memory when payload caching disabled and security interceptor present ? So the security interceptor has the needed data but the soap body is not in the memory.

    Thanks

  4. #4
    Join Date
    Mar 2008
    Posts
    11

    Default

    hello,
    tested with v1.5.4 i don't have this problem any more

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •