[jbossws-issues] [JBoss JIRA] Created: (JBWS-2157) Child nodes truncated when using jaxb to marshall data into a SOAP header

Andrew Dinn (JIRA) jira-events at lists.jboss.org
Mon Apr 21 10:57:45 EDT 2008


Child nodes truncated when using jaxb to marshall data into a SOAP  header
--------------------------------------------------------------------------

                 Key: JBWS-2157
                 URL: http://jira.jboss.com/jira/browse/JBWS-2157
             Project: JBoss Web Services
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: jbossws-native
    Affects Versions: jbossws-native-3.0.1
            Reporter: Andrew Dinn


I wish to serialise a CoordinationContext type (a complex type defined in the OASIS WS-COOR 1.1 spec) into a SOAP message header as follows:

<code>
                final JAXBContext jaxbCtx = getJaxbContext();
                final SOAPMessage soapMessage = context.getMessage();
                final SOAPEnvelope soapEnvelope = soapMessage.getSOAPPart().getEnvelope();
                SOAPHeader soapHeader = soapEnvelope.getHeader() ;
                if (soapHeader == null)
                {
                    soapHeader = soapEnvelope.addHeader() ;
                }

                Marshaller marshaller = jaxbCtx.createMarshaller();
                marshaller.marshal(coordinationContext, soapHeader);
</code>

The problem is that the header gets inserted without any children.

What happens is that the marshaller creates a SOAP tree top down consisting of SOAPElementImpl instances. It inserts these nodes into the tree below the SOAPHeader as it creates them. So, when the first node is created a call to SOAPHeader.addchild() is made. This call deteccts that the supplied node is of the wrong type so it substitutes a SOAPHeaderElementImpl. It attempts to copy the supplied node's substructure but the marshaller has not created the children at this point.
 



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jbossws-issues mailing list