I want to consume an XML-RPC service built in PHP for my WP7 app but I cannot find any examples without using xml-rpc.net’s library. I cannot create a reference to that library because it wasn’t built using the Windows Phone runtime (as VS so politely informed me).
A poster on a similar question on stackoverflow (sadly, I cannot add comments yet) suggested to use the CF version of the library but I get the same error when I try to create a reference.
I guess, if there’s no way to use that library, an alternative would be to use HttpWebRequest and parse the XML manually.
Thanks in advance for any replies!
Edit:
Here’s the XML returned, how could I go about parsing that?
XML Response: link text (Sorry for the external link, I couldn’t copy paste all that here)
Have a look at my answer to this question.
It shows a simple example of using
WebClientto get XML data from a website and then parsing it. It’s not tricky.While the example uses WebClient, this blocks on the UI thread when processing the completed thread so you will probably want to consider using HttpWebRequest instead if your processing of the returned XML is anything but trivial.
Edit:
You could do something like the following to process your response:
This assumes you have the following
and that the variable
xmlis anXElementholding the response.I’ll happily admit it’s not pretty, but it works. You’ll probably want to add lots of error handling!