Uploaded image for project: 'JBoss ESB'
  1. JBoss ESB
  2. JBESB-3589

SOAP Header data from SOAPMessageContext in JAXWS Handlers.

    Details

    • Steps to Reproduce:
      Hide

      I attach quickstart sample in order to reproduce the problem. Please copy it to quickstart sample directory and type "ant deploy" to deploy esb archive and "ant runtest" to test from client.

      Show
      I attach quickstart sample in order to reproduce the problem. Please copy it to quickstart sample directory and type "ant deploy" to deploy esb archive and "ant runtest" to test from client.

      Description

      I would like to add some JAXWS handlers in web services SOAP. I am using JBOSS SOAP 5.0.2.GA_SOA release (see boot.log for more details).

      I made a sample based on webservice_wsaddressing quickstart samples (samples\quickstarts\webservice_wsaddressing):

      • for WSAClient, I added a new JAXWS handler (MyClientHandler extends SOAPHandler<SOAPMessageContext>). This one adds context data in SOAPHeader from xml marshalled by JAXB.
      • for StatefulEndpointImpl, I added a new JAXWS handler (MyServerHandler implements SOAPHandler<SOAPMessageContext>). This one reads xml context data in SOAPHeader and give an context object from JAXB.

      This system works fine with JBOSS AS 4.2 and CXF stack.

      But using, JBOSS SOAP 5.0.2.GA and native JBossws stack, I encountered severals problems:

      • on client side, data are not correctly sent :

      hereafter a sample of HTTP SOAP Request sent :

      <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
      <env:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
      <cv:ContextVersion
      xmlns:cv="http://si.msa.fr/GestionnaireEchangesInternes/SOA/AppelServices">1.0</cv:ContextVersion>
      <ns2:MDWTargetContext
      xmlns:ns2="http://si.msa.fr/GestionnaireEchangesInternes/SOA/AppelServices/Objets/Region/v1"/>
      <wsa:To>uri:jaxrpc-samples-wsaddressing/TestService</wsa:To>
      <wsa:ReplyTo>
      <wsa:Address>http://www.w3.org/2005/08/addressing/anonymous</wsa:Address>
      <wsa:ReferenceParameters>
      <ns1:clientid xmlns:ns1="http://somens">clientid-2</ns1:clientid>
      </wsa:ReferenceParameters>
      </wsa:ReplyTo>
      <wsa:Action>http://org.jboss.ws/addressing/stateful/action</wsa:Action>
      <wsa:MessageID>urn:uuid:6f521ca2-fa85-49a7-9f1f-f9719237629e</wsa:MessageID>
      </env:Header>
      <env:Body>
      <ns1:getItems
      xmlns:ns1="http://webservice.webservicewsa.quickstart.samples.esb.soa.jboss.org/"/>
      </env:Body>
      </env:Envelope>

      We can see that MDWTargetContext has no data when marshalling in SOAPHeader (just xml structure) whereas it is correct when marshalling in System.out:

      <MDWTargetContext xmlns="http://si.msa.fr/GestionnaireEchangesInternes/SOA/AppelServices/Objets/Region/v1">
      <CORGAMO>021</CORGAMO><DPT>82</DPT><ED>E</ED><ND>N</ND></MDWTargetContext>

      • on server side, when I send a manually a correct request (because of issue on client) :

      <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
      <env:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
      <cv:ContextVersion
      xmlns:cv="http://si.msa.fr/GestionnaireEchangesInternes/SOA/AppelServices">1.0</cv:ContextVersion>

      <ns2:MDWTargetContext
      xmlns:ns2="http://si.msa.fr/GestionnaireEchangesInternes/SOA/AppelServices/Objets/Region/v1">
      <ns2:CORGAMO>021</ns2:CORGAMO>
      <ns2:DPT>82</ns2:DPT>
      <ns2:ED>E</ns2:ED>
      <ns2:ND>N</ns2:ND>
      </ns2:MDWTargetContext>

      <wsa:To>uri:jaxrpc-samples-wsaddressing/TestService</wsa:To>
      <wsa:ReplyTo>
      <wsa:Address>http://www.w3.org/2005/08/addressing/anonymous</wsa:Address>
      <wsa:ReferenceParameters>
      <ns1:clientid xmlns:ns1="http://somens">clientid-2</ns1:clientid>
      </wsa:ReferenceParameters>
      </wsa:ReplyTo>
      <wsa:Action>http://org.jboss.ws/addressing/stateful/action</wsa:Action>
      <wsa:MessageID>urn:uuid:6f521ca2-fa85-49a7-9f1f-f9719237629e</wsa:MessageID>
      </env:Header>
      <env:Body>
      <ns1:getItems
      xmlns:ns1="http://webservice.webservicewsa.quickstart.samples.esb.soa.jboss.org/"/>
      </env:Body>
      </env:Envelope>

      datas from ns2:MDWTargetContext are correctly unmarshalled, by I can't read ContextVersion data : node is found but getTextContent returns null:

      17:34:15,953 INFO [MyServerHandler] Fournisseur : Request message
      17:34:15,984 INFO [MyServerHandler] ContextVersion :
      17:34:15,984 INFO [MyServerHandler] TargetContext : ED E
      17:34:15,984 INFO [MyServerHandler] TargetContext : ND N
      17:34:15,984 INFO [MyServerHandler] TargetContext : CORGAMO 021
      17:34:15,984 INFO [MyServerHandler] TargetContext : DPT 82

      Can you help me to solve this problem :

      • to send xml context data from client in SOAP Header
      • to receive correcly ContextVersion (why getTextContext returns null).

      I attach quickstart sample in order to reproduce the problem. Please copy it to quickstart sample directory and type "ant deploy" to deploy esb archive and "ant runtest" to test from client.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                cgerbier CYRIL GERBIER
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: