Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get a value from an XML web service in C#?

In C#, if I need to open an HTTP connection, download XML and get one value from the result, how would I do that?

For consistency, imagine the webservice is at www.webservice.com and that if you pass it the POST argument fXML=1 it gives you back

<xml><somekey>somevalue</somekey></xml>

I'd like it to spit out "somevalue".

like image 476
Michael Pryor Avatar asked Jan 24 '23 03:01

Michael Pryor


1 Answers

I think it will be useful to read this first:

Creating and Consuming a Web Service (in .NET)

This is a series of tutorials of how web services are used in .NET, including how XML input is used (deserialization).

like image 64
Jon Limjap Avatar answered Jan 29 '23 06:01

Jon Limjap