[jdom-interest] SOAPPart.setContent from jdom source
Koller, Shmuel
Shmuel_Koller at bmc.com
Tue Feb 24 16:42:21 PST 2004
I have a SpmlDoc jdom document, whose content is this XML:
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:e="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><add
Response xmlns="urn:oasis:names:tc:SPML:1:0"><msg0>We are still in
com.bmc.spmlgtw.Chained1</msg0><msg1>We are still in
com.bmc.spmlgtw.Chained2</msg1><msg2>We are still in
com.bmc.spmlgtw.Chained3</msg2></addResponse></soapenv:Body></soapenv:Envelo
pe>
The code below works in putting SpmlDoc in a SOAPPart of SOAPMessage.
DOMOutputter domout = new DOMOutputter();
org.w3c.dom.Document domdoc = domout.output(SpmlDoc);
DOMSource source = new DOMSource(domdoc.getDocumentElement());
sm.getSOAPPart().setContent(source);
However I am looking for DOM-less code.
I tried this jdom-only code but it does not work, I mean I get an empty
Body.
Element jenvelope = SpmlDoc.getRootElement();
JDOMSource source = new JDOMSource(jenvelope); /* I tried also
JDOMSource(SpmlDoc) */
sm.getSOAPPart().setContent(source);
I will like a JDOM only code to load the SOAPMessage sm,
thanks, Shmuel
More information about the jdom-interest
mailing list