eeclint
asked on
What steps should I use to implement HTTP POST of an XML document?
Requirement: We have been given the ability to create Orders by creating an XML document. One of the methods available is "HTTP POST of an XML document".
What steps or tools can I use to create the "HTTP POST of an XML document"?
Thanks
What steps or tools can I use to create the "HTTP POST of an XML document"?
Thanks
ASKER
Hi Gary,
Thanks for your response.
Are there any sample pieces of code that I can use & then plugin my XML data using the C# DotNET console application ?
I'm not an expert in C# ?
Thanks again.
Thanks for your response.
Are there any sample pieces of code that I can use & then plugin my XML data using the C# DotNET console application ?
I'm not an expert in C# ?
Thanks again.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Gary,
Thanks for the code. I'll give it a shot & ask more questions if I get stuck later.
Thanks again.
Thanks for the code. I'll give it a shot & ask more questions if I get stuck later.
Thanks again.
You can run this application from a command line and pass the filename as the first argument.
The program should read the xml as a string rather than load it into an XDocument since you want to post the xml to a destination url.
The program would then instantiate a WebClient and call the UploadString() method passing the url to the server and the xml string. This will do the post.
Additional details: http://msdn.microsoft.com/en-us/library/ekfaaeay(v=vs.100).aspx
Also, there is an UploadFile() method that may make this even easier since it will read the file for you.
Gary Davis