Click here to Skip to main content
15,999,861 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I am calling a web service. It returns a response of type WebServiceNameResponse
This response has various property like below:
Dim Obj as new WebServiceNameResponse
Obj.Status
obj.message
----
Obj.Info.Line1
Obj.Info.Line2

How can i convert the custom response type to XML or a Dataset

I need to capture info part and save it in database.

Thanks
Posted

1 solution

You can use XMLSerializer class for achieving this.

C#
XmlSerializer serializer = new XmlSerializer(typeof(YourCustomClass[]));
StreamWriter writer = new StreamWriter()
serializer.Serialize(writer, objectOfCustomClass);
string xmlString = writer.ToString();
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900