Get full SOAP message
-
I have a webservice and I need to log the full SOAP message. I need to get the full SOAP message, including both SOAP Header and SOAP Body. [WebMethod] public string MyMethod() { string szSOAPMessage = ""; string szReply = ""; szSOAPMessage = ????(); // This is the part I need to know Log( szSOAPMessage ); DoSomething(); return szReply; } Does anybody know how to get it?
-
I have a webservice and I need to log the full SOAP message. I need to get the full SOAP message, including both SOAP Header and SOAP Body. [WebMethod] public string MyMethod() { string szSOAPMessage = ""; string szReply = ""; szSOAPMessage = ????(); // This is the part I need to know Log( szSOAPMessage ); DoSomething(); return szReply; } Does anybody know how to get it?
It doesnt really happen like that... the SOAP message actually specifies how to call "MyMethod", what parameters to pass to it, and what response to expect. If you compile your webservice and view it in a browser by entering debug, or browsing directly, you will see it lets you call your webmethods to test them. These pages will display a great deal of info on the format of the messages sent. To access the actual soap message in transit, you need to go one step above your actual method, to the proxy class generated for you when you add a web reference (it can be viewed by going to Project>View all files in the menu of VS).
-
I have a webservice and I need to log the full SOAP message. I need to get the full SOAP message, including both SOAP Header and SOAP Body. [WebMethod] public string MyMethod() { string szSOAPMessage = ""; string szReply = ""; szSOAPMessage = ????(); // This is the part I need to know Log( szSOAPMessage ); DoSomething(); return szReply; } Does anybody know how to get it?
Hello, Have a look at SoapExtension class in MSDN. Also see this HTH. Cheers :) Maqsood Ahmed - MCAD.net Kolachi Advanced Technologies http://www.kolachi.net