lundi 26 juin 2017

Get XML of Request and Response to a web service

In c# using Asp.net, I am trying to get the XML format of the request and response I am making to a web service. I used one of the solution from this site but it is incomplete in my situation. I am able to serialize the response but I cannot do the same for the request since I am sending in multiple parameters as request and I cannot completely figure this out.

Example :

RefreshInfo info = refreshclient.getRefreshResponse(refreshcontext, itemID);

I added the below code for response and I could see the XML format of it.

XmlSerializer xmlSerializer = new XmlSerializer(info.GetType());
using (StringWriter textWriter = new StringWriter())
{
    xmlSerializer.Serialize(textWriter, info );
    string repsonsexml = textWriter.ToString();
}

How can I do the same for the request from this?

Help is appreciated.. Thank you!!




Aucun commentaire:

Enregistrer un commentaire