Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Apr 02, 2012 03:42 AM by Steven Cheng - MSFT
Mar 29, 2012 10:41 AM|LINK
I have a .xsd file which contains all the details of web method request and response, i want to post this xsd file to particular URL while calling web method.
How can I do this.
Please let me know.
Thanks In advance,
Apr 02, 2012 03:42 AM|LINK
If you have got the XSD schema for the request/response message format, you have the following options for send/receive data with the target web service:
1) Use .NET XML serialziation. YOu can use xsd.exe tool to generate some .NET helper class which represent the request/response messages.
#XML Schema Definition Tool (Xsd.exe)
And you can use the XmlSerializer type to generate XML format output based on the helper types and also convert XML content back to instances of the helper types at runtime:
#Introducing XML Serialization
2) Or if the schema is not very complicated, you can also use LINQ to XML to manually construct the XML format request messages(and the containing elements)
#.NET Language-Integrated Query for XML Data
In addition, after you construct the messages, you can use WebRequest class to send the message to the target service endpoint and retrieve response back.
#Post XML Data to an ASP.NET Page using C#
#How to: Send Data Using the WebRequest Class