[jdom-interest] SOAPPart.setContent from jdom source

Koller, Shmuel Shmuel_Koller at bmc.com
Wed Feb 25 14:21:04 PST 2004


I work WASP, but its in the scope of SAAJ - buiding SOAPPart.
I migrated to jdom b10, but it does not help me.

The JDOM one line  that is in comment results in empty SOAP: 
<?xml version="1.0" encoding="UTF-8"?>
<e:Envelope
xmlns:e="http://schemas.xmlsoap.org/soap/envelope/"><e:Body/></e:Envelope>

Which means that setcontent from JDOMSource does not work.

Here is the code again, as it works via DOM which I want to avoid, 
thanks, Shmuel 

 DOMOutputter domout = new DOMOutputter();
 org.w3c.dom.Document domdoc = domout.output(SpmlDoc);
 DOMSource source = new DOMSource(domdoc.getDocumentElement());
// JDOMSource source = new JDOMSource(jenvelope);
// JDOMSource source = new JDOMSource(SpmlDoc);
 sm.getSOAPPart().setContent(source);
 sm.saveChanges();
 return sm;


-----Original Message-----
From: Per Norrman [mailto:pernorrman at telia.com]
Sent: Wednesday, February 25, 2004 2:23 PM
To: 'Koller, Shmuel'; jdom-interest at jdom.org
Subject: SV: [jdom-interest] SOAPPart.setContent from jdom source


Hi,

I tried your example and it works for me.
I'm using JDOM b10 and axis 1.1.

/pmn

> -----Ursprungligt meddelande-----
> Från: jdom-interest-admin at jdom.org 
> [mailto:jdom-interest-admin at jdom.org] För Koller, Shmuel
> Skickat: den 25 februari 2004 12:37
> Till: jdom-interest at jdom.org
> Ämne: RE: [jdom-interest] SOAPPart.setContent from jdom source
> 
> 
> Trying to simplfy the help I need :
> Given you have a populated SOAP envelope as JDOM Document - 
> have you succeded to load it into SAAJ message SOAPPart using
> SOAPPart.setcontent(jdom-whatever)
> 
> If you have some JAXM server code or JAXM client code that 
> buids the SOAP Envelope using JDOM - I need the code to put 
> that jdom stuff inside the SAAJ SOAPPart.
> 
> This works from me only if I pass the JDOM tree via a 
> transformation to org.w3c.dom. Also - it works for me the 
> other way , from SAAJ SOAPPart directly into JDOM document. 
> 
> I just miss building SOAPPart  from JDOM source,
> Shmuel 
> 
> -----Original Message-----
> From: Koller, Shmuel [mailto:Shmuel_Koller at bmc.com]
> Sent: Wednesday, February 25, 2004 2:42 AM
> To: jdom-interest at jdom.org
> Subject: [jdom-interest] SOAPPart.setContent from jdom source
> 
> 
> 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/"><soa
> penv: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 
> _______________________________________________
> To control your jdom-interest membership: 
> http://lists.denveronline.net/mailman/options/jdom-interest/yo
uraddr at yourhos
t.com
_______________________________________________
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@you
rhost.com



More information about the jdom-interest mailing list