[
https://issues.jboss.org/browse/JBWS-2157?page=com.atlassian.jira.plugin....
]
Alessio Soldano updated JBWS-2157:
----------------------------------
Fix Version/s: jbossws-native-4.0.1
(was: jbossws-native-4.0)
Child nodes truncated when using jaxb to marshall data into a SOAP
header
--------------------------------------------------------------------------
Key: JBWS-2157
URL:
https://issues.jboss.org/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
Fix For: jbossws-native-4.0.1
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, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira