Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: what's so wrong with my code?? Just trying to save a single node out of a SOAP Envelope

From: monsalvo@-----.---
To: NULL
Date: 8/12/2008 10:38:00 AM
Thanks a lot Joe!!
I'll figuring things out. Wanna get your book on XML here in
Argentina.  They have it listed. Though delivery will take some 45
days.

Regards.

Martin


On Aug 8, 4:03=A0am, "Joe Fawcett" <joefawc...@hotmail.com> wrote:
> <monsa...@gmail.com> wrote in message
>
> news:36b652eb-52fb-4e8e-a022-9af51470c3a3@s......
>
>
>
> > What's so wrong with my code?
>
> > This line is part of a VBScript soap client part of a DTS wich is
> > functional in a 90 percent.
>
> > strText =3D .responseXML.selectSingleNode("//" login "loginReturn")
>
> > Produces the following error
> > Char: 46
> > Error: Expeted )
>
> > If I code it like this
> > strText =3D .responseXML.selectSingleNode("//loginReturn")r
>
> > I get this error..
> > Char: 1
> > Error: Object doesn't support this property or method
>
> > If I Place ) in char 46 I get this error.
> > Error is Expected end of Statement.
>
> > I just want to extract a single node (loginReturn) out of the SOAP
> > Envelope instead of saving the whole SOAP reponse. I'm able to save
> > the full envelope to a file, but that is not what I want.
> > It would be the same, what if I want to store the value of loginReturn
> > in this case 481557228026 in a variable?
>
> > Just in case what follows is the response envelop from my web service.
>
> > <soapenv:Envelope xmlns:soapenv=3D"http://schemas.xmlsoap.org/soap/
> > envelope/" xmlns:xsd=3D"http://www.w3.org/2001/XMLSchema"
> > xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance">
> > =A0 <soapenv:Body>
> > =A0 =A0 =A0<ns1:loginResponse soapenv:encodingStyle=3D"http://
> > schemas.xmlsoap.org/soap/encoding/" xmlns:ns1=3D"http://nn.nn.nn.com">
> > =A0 =A0 =A0 =A0 <loginReturn xsi:type=3D"xsd:string">481557228026</logi=
nReturn>
> > =A0 =A0 =A0</ns1:loginResponse>
> > =A0 </soapenv:Body>
> > </soapenv:Envelope>
>
> > Please forgive my ingnorance I'm totally a newcomer to XML and
> > VBscript.
>
> > Thanks in Advance.
>
> > Martin
>
> Neither expression is not syntactically correct.
> You need, assuming you have mapped the namespace URIs to the prefixes
> 'soapenv' and 'ser' as per my earlier response):
> Dim oLoginNode
> Set oLoginNode =3D
> .responseXML.selectSingleNode("/*/soapenv:Body/ser:loginResponse/ser:logi=
nR=ADeturn")
> MsgBox oLoginNode.text
>
> or for a more inefficient search:
> Set oLoginNode =3D .responseXML.selectSingleNode("//ser:loginReturn")
>
> If you are using the responseXML directly you should call:
> .responseXML.setproperty "SelectionLanguage", "XPath"
> before using selectSingleNode or selectNodes.
>
> --
>
> Joe Fawcett (MVP - XML)http://joe.fawcett.name- Hide quoted text -
>
> - Show quoted text -



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent