[jboss-user] [JBoss Web Services] - Re: How to modify SOAP body in JBoss 6.1.0. final?

Jim Ma do-not-reply at jboss.com
Mon Feb 6 02:19:41 EST 2012


Jim Ma [https://community.jboss.org/people/jim.ma] created the discussion

"Re: How to modify SOAP body in JBoss 6.1.0. final?"

To view the discussion, visit: https://community.jboss.org/message/714553#714553

--------------------------------------------------------------
>From the error stack trace, looks you are using jbossws-cxf stack to send message. Because jbossws-cxf uses different saaj implementation, soapFactory.newInstance().createElement() could create element with another document. Below is an example appendChild with the retrieved document from soapBody, it may help resolve your problem.   

SOAPMessage soapMessage = messagecontext.getMessage();
SOAPBody soapBody = soapMessage.getSOAPBody();
Node firstChild = soapBody.getFirstChild();
Document doc = firstChild.getOwnerDocument();
Node node1 = doc.createElementNS("http://www.foo.org", "bar");
node1.appendChild(doc.createTextNode("text"));
firstChild.appendChild(node1); 
soapMessage.saveChanges();
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/714553#714553]

Start a new discussion in JBoss Web Services at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2044]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120206/29444e9b/attachment.html 


More information about the jboss-user mailing list