Groups | Blog | Home
all groups > dotnet xml > november 2003 >

dotnet xml : Read XML response from SOAP with VB.NET


the_saint_gr NO[at]SPAM hotmail.com
11/13/2003 3:26:19 AM
I am building a Vb.NET Soap Client and i have a problem reading the
response of the SOAP message.

I need to read the results i have the following code:

Dim ws As New WebReference1.PaymentService()
Dim test As String
test = ws.invoiceAvailability("1", "username",
"password").ToString

The result stored in the "test: variable is the following:

<result code="2"/><contract_id> "1"</contract_id><tax_number>
"111111"</tax_number><name> "Cust1 Name1"</name><balance>
"50.0"</balance></result>

Is there any way to Read this as an XML document? I need for example
to read only one field, without having to process the whole string.

Oleg Tkachenko
11/13/2003 2:03:15 PM
[quoted text, click to view]

Take a look at LoadXml() method of XmlDocument class. But if you need
only read some values from the XML, XMLDocument is too uneffective for
that, use XPathDocument or even plain XmlReader depending on how complex
your query is.
--
Oleg Tkachenko
XML Insider
http://www.tkachenko.com/blog
the_saint_gr NO[at]SPAM hotmail.com
11/14/2003 6:01:03 AM
Thanks.

Could you be more specific by some kind of example for each case?

Thanks a lot.

[quoted text, click to view]
Daniel Cazzulino
11/14/2003 12:58:59 PM
There's a myth against XmlDocument. It's almost as efficient as
XPathDocument (at least in v1.1) and actually better for big documents
(500k+).
You should use the one that best fits your programming needs.
I'll post the numbers in my weblog sometime...

Daniel Cazzulino
Lagash Systems SA
http://weblogs.asp.net/cazzu


[quoted text, click to view]

Oleg Tkachenko
11/16/2003 10:44:52 AM
[quoted text, click to view]

That's really interesting to make some measurements. Anyway, as far as I
measured (really roughly) XmlDocument is 30% slower than XPathDocument
in XPath queries (well, obviously).
--
Oleg Tkachenko
XML Insider
http://www.tkachenko.com/blog
Daniel Cazzulino
11/16/2003 9:45:39 PM
Yup, it would be good to make those tests. However, the XmlDocument is
usually unadvised because of its weight not because of its (lack of) speed
for executing XPath....


[quoted text, click to view]

AddThis Social Bookmark Button