[
https://jira.jboss.org/jira/browse/JBWS-2157?page=com.atlassian.jira.plug...
]
Lucas Cavalcanti commented on JBWS-2157:
----------------------------------------
It also happens when you try to marshal anything into the SOAPBody:
final JAXBContext jaxbCtx = getJaxbContext();
final SOAPMessage soapMessage = context.getMessage();
SOAPBody body = soapMessage.getSOAPBody();
Marshaller marshaller = jaxbCtx.createMarshaller();
marshaller.marshal(anything, body);
Same for:
Transformer transformer = TransformerFactory.newInstance().newTransformer();
transformer.transform(new StreamSource(myXml), new DOMResult(body));
Child nodes truncated when using jaxb to marshall data into a SOAP
header
--------------------------------------------------------------------------
Key: JBWS-2157
URL:
https://jira.jboss.org/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:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira