3

How to convert xml data into JSON format. I want to send it over the SOAP, too.

Could you provide some example?

ChrisF
  • 134,786
  • 31
  • 255
  • 325
Tanmay Nehete
  • 2,138
  • 4
  • 31
  • 42
  • 1
    It looks like 2 different questions to me, one about conversion from XML to JSON format, the other one is about C# library for SOAP usage. It would be better if you concentrate your question and show what have you already tried. – Rami Yampolsky Jul 26 '15 at 10:03

1 Answers1

11

You can use JsonConvert class to convert.

here is the code

 // To convert an XML node contained in string xml into a JSON string   
    XmlDocument doc = new XmlDocument();
    doc.LoadXml(xml);
    string jsonText = JsonConvert.SerializeXmlNode(doc);

    // To convert JSON text contained in string json into an XML node
    XmlDocument doc = JsonConvert.DeserializeXmlNode(json);

The above code is from here How to convert JSON to XML or XML to JSON?

For sending data through soap Client to send SOAP request and received response

Community
  • 1
  • 1
user786
  • 3,902
  • 4
  • 40
  • 72