473,327 Members | 1,919 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

what's so wrong with my code?? Just trying to save a single node outof a SOAP Envelope

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 = .responseXML.selectSingleNode("//" login "loginReturn")

Produces the following error
Char: 46
Error: Expeted )

If I code it like this
strText = .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="http://schemas.xmlsoap.org/soap/
envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:loginResponse soapenv:encodingStyle="http://
schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://nn.nn.nn.com">
<loginReturn xsi:type="xsd:string">481557228026</loginReturn>
</ns1:loginResponse>
</soapenv:Body>
</soapenv:Envelope>

Please forgive my ingnorance I'm totally a newcomer to XML and
VBscript.
Thanks in Advance.
Martin
Aug 7 '08 #1
2 2335


<mo******@gmail.comwrote in message
news:36**********************************@s50g2000 hsb.googlegroups.com...
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 = .responseXML.selectSingleNode("//" login "loginReturn")

Produces the following error
Char: 46
Error: Expeted )

If I code it like this
strText = .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="http://schemas.xmlsoap.org/soap/
envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:loginResponse soapenv:encodingStyle="http://
schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://nn.nn.nn.com">
<loginReturn xsi:type="xsd:string">481557228026</loginReturn>
</ns1:loginResponse>
</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 =
..responseXML.selectSingleNode("/*/soapenv:Body/ser:loginResponse/ser:loginReturn")
MsgBox oLoginNode.text

or for a more inefficient search:
Set oLoginNode = .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
Aug 8 '08 #2
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*am, "Joe Fawcett" <joefawc...@hotmail.comwrote:
<monsa...@gmail.comwrote in message

news:36**********************************@s50g2000 hsb.googlegroups.com...
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 = .responseXML.selectSingleNode("//" login "loginReturn")
Produces the following error
Char: 46
Error: Expeted )
If I code it like this
strText = .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="http://schemas.xmlsoap.org/soap/
envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
* <soapenv:Body>
* * *<ns1:loginResponse soapenv:encodingStyle="http://
schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://nn.nn.nn.com">
* * * * <loginReturn xsi:type="xsd:string">481557228026</loginReturn>
* * *</ns1:loginResponse>
* </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 =
.responseXML.selectSingleNode("/*/soapenv:Body/ser:loginResponse/ser:loginR*eturn")
MsgBox oLoginNode.text

or for a more inefficient search:
Set oLoginNode = .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 -
Aug 12 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Russell | last post by:
Using Python 2.3 and ZSI 1.2 I am having problems getting information back from a test web service running on a PC on our LAN. The SOAP request details (from the .asmxfile) are as follows: ...
125
by: Sarah Tanembaum | last post by:
Beside its an opensource and supported by community, what's the fundamental differences between PostgreSQL and those high-price commercial database (and some are bloated such as Oracle) from...
1
by: news.comcast.net | last post by:
after reading soap specification at w3c i have a few questions 1) you can't use soap-envelope namespace with application specific <element>? since soap schema have not define namespace (env)...
3
by: GT | last post by:
I have a .NET client that consumes an Axis web service. A change was made recently to the AXIS web service, and ever since then my .NET proxy class has been throwing an InvalidCastException. The...
0
by: tshad | last post by:
I am trying to create a proxy and soap from a sample file and it won't create multiple dimensional arrays for some reason. I am getting the same results if "Line" is not a Multidimensional array. ...
0
by: Philluminati | last post by:
I have a Perl SOAP Server which returns this SOAP Message when invoked: <?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:xsi="http:// www.w3.org/2001/XMLSchema-instance"...
0
by: =?Utf-8?B?ZWQ=?= | last post by:
I had this exact problem using a vb.net client accessing a Java web service. The solution takes 3 steps: 1.) Create custom ClientOutputFilter 2.) Create a custom Assertion that uses filter from...
4
by: moorcroft | last post by:
Hi, I'm new to using SOAP so apologies for any ignorance on my part! I'm trying to write java code to create the following SOAP message and return message, and am wondering if someone could...
0
by: Default User | last post by:
I work on creating test cases for a SOAP-based set of servers, using soapUI. I received and updated set of WSDL and schema files, and when I made new tests and mock server operations, all of the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.