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.
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.
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:
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)
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.
monze
Member
10 Points
15 Posts
Post xsd file on particuler URL.
Mar 29, 2012 10:41 AM|LINK
Hi Friends,
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,
Regards,
Manoj Gupta
Steven Cheng...
Contributor
4199 Points
548 Posts
Microsoft
Moderator
Re: Post xsd file on particuler URL.
Apr 02, 2012 03:42 AM|LINK
Hi monze,
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)
http://msdn.microsoft.com/en-us/library/x6c1kb0s(v=vs.100).aspx
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
http://msdn.microsoft.com/en-us/library/182eeyhh.aspx
#XmlSerializer Class
http://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlserializer.aspx
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
http://msdn.microsoft.com/en-us/library/bb308960.aspx
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#
http://www.codeproject.com/Articles/10430/Post-XML-Data-to-an-ASP-NET-Page-using-C
#How to: Send Data Using the WebRequest Class
http://msdn.microsoft.com/en-us/library/debx8sh9.aspx
Feedback to us
Microsoft One Code Framework