[
http://jira.jboss.com/jira/browse/JBWS-1692?page=comments#action_12364111 ]
Anil Saldhana commented on JBWS-1692:
-------------------------------------
soap-request-template.xml
======================
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<a xmlns="urn:custom">
</a>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
import-node.xml
==============
<b:Request xmlns:b="urn:custom-ns">
</b:Request>
I want the final SOAP Message to look as follows:
=================================
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<a xmlns="urn:custom">
<b:Request xmlns:b="urn:custom-ns">
</b:Request>
</a>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Please refer to the Document#importNode API for more details:
http://java.sun.com/j2se/1.5.0/docs/api/org/w3c/dom/Document.html#importN...
SAAJ:importNode needs to work
-----------------------------
Key: JBWS-1692
URL:
http://jira.jboss.com/jira/browse/JBWS-1692
Project: JBoss Web Services
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: jbossws
Reporter: Anil Saldhana
If I have a SOAPMessage constructed using the MessageFactory interface, I should be able
to import a node from a different document and append to the first child of soap body.
This does not work correctly. I have tested this against the SAAJ RI and it works fine
there.
Here is sample code:
MessageFactory factory = MessageFactory.newInstance();
File soapreqfile = new File("soap-request-template.xml");
SOAPMessage msg = factory.createMessage(null, new FileInputStream(soapreqfile));
//Get the node that needs to be imported
Node someNode = getNode("import-node.xml");
//Import the node
Node importedNode = msg.getSOAPPart().getOwnerDocument().importNode(someNode, true);
//Append the node to the first child
msg.getSOAPBody.getFirstChild().appendChild(importedNode);
--
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