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 Scott Nichol <sn...@scottnichol.com> on 2002/10/09 17:44:14 UTC

Re: Parsing SOAP message request in Java

You want to use the getBody method of Envelope.  In turn, the
getBodyEntries method of Body will let you access the immediately
children of the <s:Body> element.  Normally, this would be the method
call (below you have <name>, which I would guess to be a SOAP struct).

Scott Nichol

----- Original Message -----
From: <Ka...@lincsoftware.soft.net>
To: "SOAP-Dev" <so...@xml.apache.org>
Sent: Thursday, October 10, 2002 5:58 AM
Subject: Parsing SOAP message request in Java


> Hi All,
>
>  I want to know how can i access a request that has been sent thru the
> message.sent() method ..
>
> for example..
> i send my xml document through this soap method
>
>  msg.send (new URL ("http://localserver/soap/messagerouter"),
> "urn:testservice", msgEnv);
>
> where msgEnv parsed is a soap xml. which contains the following xml
file
> <?xml version="1.0" encoding="UTF-8" ?>
>  <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
>      <s:Body>
>           <name>
>           <first>
>            XXX
>           </first >
>          <last>
>              YYY
>             </last>
>           </name>
>      </s:Body>
>   </s:Envelope>
>
> 1) now i need to parse the soap/xml document in the mentod called
> doRegister() deployed in urn:testservice.
> 2)
> here is am sample of the method doRegister
>
>
> public void doRegistration(Envelope env, SOAPContext req, SOAPContext
res)
>           throws IOException, MessagingException
>  {
>
>           try{
>
>           String firstName = null;
>           String lastName = null;
>           String output =null;
>
>           Vector lovcEntries = env.getEnvelopeEntries();  //trying to
get
> the xml file contents
>
>                          }
>
>
>           catch(Exception ex){
>
>                System.out.println("Exception in the RegisterService ::
> doRegistration()");
>
>           }
>      }
>
> i want to get the first and last name tag's from the SOAP/xml. how do
i get
> it. but by using the above env.getEnvelopeEntries() i am not able to
get
> entries. Can anyone suggest me how to parse the Sent xnl fine.
>
> can anyone help me pls....
>
> Thanks,
> Kavitha
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>