473,379 Members | 1,222 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,379 software developers and data experts.

querying soap result

I get the following result from a webservice. I pass this string to an XML
Document. Can someone explain, how can I query the <result> out of the xml,
using xpath query language (ie. using selectsinglenode function)

Thanks,
Alwin S.
?xmlResult.xml
<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<result>
<rows/>
</result>
</soap:Body>
</soap:Envelope>
Nov 16 '05 #1
3 1622
Al,

The xpath expression you would want is:

soap:Body\result

That should give you the rows node.

However, I am curious, why not just set a web reference to the web
service, and use that? All the plumbing will be hooked up for you and you
don't have to worry about parsing this out yourself.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Al Sav" <Al***@discussions.microsoft.com> wrote in message
news:20**********************************@microsof t.com...
I get the following result from a webservice. I pass this string to an XML
Document. Can someone explain, how can I query the <result> out of the
xml,
using xpath query language (ie. using selectsinglenode function)

Thanks,
Alwin S.
?xmlResult.xml
<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<result>
<rows/>
</result>
</soap:Body>
</soap:Envelope>

Nov 16 '05 #2
soap:Body/result didnt work.

Its referring to the soap namespace. I need to know how to query xml
containing namespace references.

We have a portability issue in our application that restricts us from using
soapclient or webreference for this project.

Alwin S.

"Nicholas Paldino [.NET/C# MVP]" wrote:
Al,

The xpath expression you would want is:

soap:Body\result

That should give you the rows node.

However, I am curious, why not just set a web reference to the web
service, and use that? All the plumbing will be hooked up for you and you
don't have to worry about parsing this out yourself.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Al Sav" <Al***@discussions.microsoft.com> wrote in message
news:20**********************************@microsof t.com...
I get the following result from a webservice. I pass this string to an XML
Document. Can someone explain, how can I query the <result> out of the
xml,
using xpath query language (ie. using selectsinglenode function)

Thanks,
Alwin S.
?xmlResult.xml
<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<result>
<rows/>
</result>
</soap:Body>
</soap:Envelope>


Nov 16 '05 #3
Al,

I forgot to mention, you have to set up the namespace alias on the
document so that it knows that "soap" maps to a particular namespace. You
would do this using the XmlNamespaceManager class, and then pass it in your
call to SelectNodes or SelectSingleNode.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Al Sav" <Al***@discussions.microsoft.com> wrote in message
news:E5**********************************@microsof t.com...
soap:Body/result didnt work.

Its referring to the soap namespace. I need to know how to query xml
containing namespace references.

We have a portability issue in our application that restricts us from
using
soapclient or webreference for this project.

Alwin S.

"Nicholas Paldino [.NET/C# MVP]" wrote:
Al,

The xpath expression you would want is:

soap:Body\result

That should give you the rows node.

However, I am curious, why not just set a web reference to the web
service, and use that? All the plumbing will be hooked up for you and
you
don't have to worry about parsing this out yourself.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Al Sav" <Al***@discussions.microsoft.com> wrote in message
news:20**********************************@microsof t.com...
>I get the following result from a webservice. I pass this string to an
>XML
> Document. Can someone explain, how can I query the <result> out of the
> xml,
> using xpath query language (ie. using selectsinglenode function)
>
> Thanks,
> Alwin S.
>
>
> ?xmlResult.xml
> <?xml version="1.0"?>
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> <soap:Body>
> <result>
> <rows/>
> </result>
> </soap:Body>
> </soap:Envelope>


Nov 16 '05 #4

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

Similar topics

3
by: parrot toes | last post by:
Summary: I have been trying to make requests of a web service provided by Axis using a dotnet client with code generated by wsdl.exe and have been getting exceptions when trying to process the...
5
by: Robbert van Geldrop | last post by:
Hello, I have a problem consuming a WebService which appears to be dependent of the type of network I am on: The following SOAP response is not processed when I am connected over the internet...
2
by: furrypop | last post by:
Hi, I'm trying to get the Perl SOAP::Lite examples to work on a Windows PC, running Apache 2.2.4. Apache is definitely serving CGI scripts, as I've tested a dummy Hello World thing. I'm also...
1
by: parimalb | last post by:
Hi All, I want to pass an array argument to the java webservice from perl client using SOAP::LITE package. Please let me know if anyone knows about this. The web method declaration in java is...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.