0 Replies Latest reply on Feb 15, 2007 9:11 AM by Martin Steinle

    ws4ee-Stack: Handler for mustUnderstand header

    Martin Steinle Newbie

      Hello,

      I am using JBoss 4.0.3sp1 with the ws4ee stack delivered with JBoss 4.0.4. I have implemented a simple servlet based endpoint. To secure access to the endpoint, I use WS-Security and a jaxrpc handler of my own to handle the ws-security header in soap messages. Because clients set mustUnderstand="1" on the header, my handler must either set this attribute to 0 or remove the header from the SOAP message to prevent JBoss from throwing an exception with the message "unprocessed mustUnderstand header". But if I do so, the stack behaves very strange when serializing a response: It serializes the contents of the body twice.
      Debugging JBoss, I found out that method

      org.jboss.webservice.handler.ServerHandlerChain.handleRequest(MessageContext)
      checks if the handlers changed the soap request message and if so, replaces the value of the property axis.provider.java.rpc-invocation in the MessageContext.
      I also found out, that methods
      org.jboss.webservice.server.InvokerProviderJSE.invokeTarget(RPCInvocation)
      and
      org.jboss.axis.providers.java.RPCProvider.processMessage(MessageContext, SOAPEnvelopeAxisImpl, SOAPEnvelopeAxisImpl, Object)
      invoke method
      org.jboss.axis.providers.java.RPCInvocation.prepareFromRequestEnvelope()
      on different objects. This again is the reason that the contents of the body of the response message is doubled.

      Is there any solution to this problem, so I will be able to use soap headers with attribute mustUnderstand="1"?

      Regards,
      Martin