How can I capture an HTTP Post with a web service method? I also need to send back an XML response. I have added "HttpPost" and "HttpSoap" to the <protocols> section of my web config, but still
receive 500 server errors. I'm trying to send the XML post to an endpoint like this:
http://blahblah.com/myWebService.asmx/GetMessage
and have tried to capture the post a couple of different ways:
[WebMethod]
public XmlDocument GetMessage(XmlDocument myDoc)
{ }
or
[WebMethod]
public XmlDocument GetMessage(string myDoc)
{ }
...or is there a better way to do this with an .aspx page?
JohnnyBravo
Member
10 Points
16 Posts
Capturing XML HTTP Post with Web Service Method
Mar 22, 2012 09:18 PM|LINK
Hi,
How can I capture an HTTP Post with a web service method? I also need to send back an XML response. I have added "HttpPost" and "HttpSoap" to the <protocols> section of my web config, but still receive 500 server errors. I'm trying to send the XML post to an endpoint like this:
http://blahblah.com/myWebService.asmx/GetMessage
and have tried to capture the post a couple of different ways:
[WebMethod]
public XmlDocument GetMessage(XmlDocument myDoc)
{ }
or
[WebMethod]
public XmlDocument GetMessage(string myDoc)
{ }
...or is there a better way to do this with an .aspx page?
Thank you for any direction or help with this!
Johnny Bravo
Peter pi - M...
Star
12871 Points
1786 Posts
Re: Capturing XML HTTP Post with Web Service Method
Mar 26, 2012 01:41 AM|LINK
Hi,
If you want to capture the raw message, you could use SoapExtensions, please focus on the example in the following article.
#SoapExtension
http://msdn.microsoft.com/en-us/library/system.web.services.protocols.soapextension.aspx
and here is a similar post to which you can refer.
http://stackoverflow.com/questions/2624621/capturing-soap-requests-to-an-asp-net-asmx-web-service
Regards,
Peter
If you have any feedback about my replies, please contact msdnmg@microsoft.com
Microsoft One Code Framework