C#: How to get the raw xml returned from a webservice request

Posted by Unknown On Thursday, June 15, 2017 0 comments

How to get the raw xml from a webservice request or response


XmlSerializer xmlSerializer = new XmlSerializer(oResponse.GetType());

using (StringWriter textWriter = new StringWriter())
{
    xmlSerializer.Serialize(textWriter, oResponse);
    var xmlText = textWriter.ToString();
}

0 comments:

Post a Comment