简体   繁体   中英

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!!

I think the answer is right here. Posted too early, I suppose!

Generating XML from multiple classes?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM