pmorelli92/SoapHttpClient

How to Parse the XML Response?

Closed this issue · 6 comments

I have tried the NASA SOAP API though it is working properly. I got the XML String.

How to parse it to object to loop and show the result?

@pmorelli92 Please help me on this asap

Hi @anant-svc,

This library is not parsing the response messages but it should be as simple as this to get it working on your code:

var response =  @"<root><asd value=""12"" /></root>" 
var xElement = XElement.Parse(obj);
xElement.Elements().Single().Name == "asd" // true

@pmorelli92 1 more question:
How to send body to SOAP API?
Like to send parameters to the server and server processes on it then sends the response XML.
Can you show me an working example?

Hi @anant-svc, I am not understanding what you are trying to tell me.

LIke I want to send some parameters to SOAP server then, how to create the request body?

Hi @anant-svc, you have the signatures on the README and some examples on the tests. Basically a soap message consist on the headers and body on XML format.

So what this API exposes are signatures for you not to construct the envelope yourself but just sending XElement of the headers and body you want to send. If your question is how do I construct an XML as a XElement then I recommend you to look into MSDN documentation.

Regards.