You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@xml.apache.org by Amit Verma <am...@geometricsoftware.com> on 2002/06/17 20:37:23 UTC
getting data back from soap envelope
Hi,
Has ne one got an idea on how can one get the xml document back from the
Envelope that is created on the client side when writing Message Services
using SOAP.
////sample code for creating the Envelope from the xml document.
===================================
Envelope msgEnv = Envelope.unmarshall(doc.getDocumentElement());
// send the message
Message smsg = new Message ();
smsg.send(new URL ("http://infinity:5555/servlet/messagerouter"),
"urn:Login", msgEnv);
===================================
Now how can I get this back at the service side method call:
public void doLogin(Envelope envp, SOAPContext reqCtx, SOAPContext
resCtx)
How to extract the envelop content on the service side ???
-Amit.
Re: getting data back from soap envelope
Posted by Scott Nichol <sn...@scottnichol.com>.
You can use Envelope#marshall to recreate the Envelope as an XML text
string. I do not believe there is a method to produce a DOM directly from
an Envelope. The getEnvelopeEntry, getHeader and getBody methods get you
much of what you need, but for each entity (Envelope, Header and Body), it
is not possible to get the list of attributes. Therefore, if you want a
DOM, you need to recreate the Envelope as an XML string, then read the
string into a DOM.
Scott Nichol
----- Original Message -----
From: "Amit Verma" <am...@geometricsoftware.com>
To: <so...@xml.apache.org>
Sent: Monday, June 17, 2002 2:37 PM
Subject: getting data back from soap envelope
> Hi,
>
> Has ne one got an idea on how can one get the xml document back from the
> Envelope that is created on the client side when writing Message Services
> using SOAP.
>
> ////sample code for creating the Envelope from the xml document.
> ===================================
> Envelope msgEnv = Envelope.unmarshall(doc.getDocumentElement());
> // send the message
> Message smsg = new Message ();
> smsg.send(new URL ("http://infinity:5555/servlet/messagerouter"),
> "urn:Login", msgEnv);
> ===================================
>
> Now how can I get this back at the service side method call:
>
> public void doLogin(Envelope envp, SOAPContext reqCtx, SOAPContext
> resCtx)
>
> How to extract the envelop content on the service side ???
>
> -Amit.
>
>
Re: getting data back from soap envelope
Posted by Scott Nichol <sn...@scottnichol.com>.
You can use Envelope#marshall to recreate the Envelope as an XML text
string. I do not believe there is a method to produce a DOM directly from
an Envelope. The getEnvelopeEntry, getHeader and getBody methods get you
much of what you need, but for each entity (Envelope, Header and Body), it
is not possible to get the list of attributes. Therefore, if you want a
DOM, you need to recreate the Envelope as an XML string, then read the
string into a DOM.
Scott Nichol
----- Original Message -----
From: "Amit Verma" <am...@geometricsoftware.com>
To: <so...@xml.apache.org>
Sent: Monday, June 17, 2002 2:37 PM
Subject: getting data back from soap envelope
> Hi,
>
> Has ne one got an idea on how can one get the xml document back from the
> Envelope that is created on the client side when writing Message Services
> using SOAP.
>
> ////sample code for creating the Envelope from the xml document.
> ===================================
> Envelope msgEnv = Envelope.unmarshall(doc.getDocumentElement());
> // send the message
> Message smsg = new Message ();
> smsg.send(new URL ("http://infinity:5555/servlet/messagerouter"),
> "urn:Login", msgEnv);
> ===================================
>
> Now how can I get this back at the service side method call:
>
> public void doLogin(Envelope envp, SOAPContext reqCtx, SOAPContext
> resCtx)
>
> How to extract the envelop content on the service side ???
>
> -Amit.
>
>