createElementNS adds empty XMLNS to lower tags
Hi im working on sending a soap message
I get the soap message part made but have to add in a default namespace to one of the tags, so I create a new elementNS add the child node of the tag it will replace and then do replacechild to swap the old node with the new node that has the xmlns.
I then add another node within that node.
SOAPBody body = soapMessage.getSOAPBody();
Node soapXML = body.getFirstChild().getFirstChild();
String nodeName = body.getFirstChild().getNodeName();
Element actionElement = soapMessage.getSOAPPart().createElementNS("http://Dealogic.com/DAAPI", nodeName);
actionElement.appendChild(soapXML);
body.replaceChild(actionElement, body.getFirstChild());
SOAPElement sSKIDNode = (SOAPElement)soapMessage.getSOAPPart().createElementNS(null, DEALAXIS_SSKID);
sSKIDNode.addTextNode(sSKID);
((SOAPElement)body.getFirstChild()).addChildElement(sSKIDNode);
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
<InvestorUpload xmlns="http://Dealogic.com/DAAPI">
<xmlInvestor xmlns="">
<INVESTOR></INVESTOR>
</xmlInvestor>
<sSKID xmlns=""></sSKID>
</InvestorUpload>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
before the swap the xmlInvestor and sSKID tags do not havd xmlns but after they have the xmlns="" that you can see. these later present a problem when sending to the web service.
Is there a way in that i can stp this happening
chers

