ws-soap-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Nichol <snicholn...@scottnichol.com>
Subject Re: Parsing SOAP message request in Java
Date Wed, 09 Oct 2002 15:44:14 GMT
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: <KavithaK@lincsoftware.soft.net>
To: "SOAP-Dev" <soap-dev@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:   <mailto:soap-dev-unsubscribe@xml.apache.org>
> For additional commands, e-mail: <mailto:soap-dev-help@xml.apache.org>
>
>


Mime
View raw message