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&...]