Create a SoapExtensionAttributefor the SOAP Extension that can be applied to an XML Web service method. TextWriter writer = new StreamWriter(to) TextReader reader = new StreamReader(from) String soapString = (message is SoapServerMessage) ?"SoapRequest" : "SoapResponse" ![]() Public void WriteInput(SoapMessage message) W.WriteLine("-" + soapString + " at " + DateTime.Now) String soapString = (message is SoapServerMessage) ?"SoapResponse" : "SoapRequest" Public void WriteOutput(SoapMessage message)įileStream fs= new FileStream(filename,FileMode.Append,FileAccess.Write) Public override void ProcessMessage(SoapMessage message) SaveSoapRequest or SoapResponse to the log file. Public override void Initialize( object initializer) Public override object GetInitializer(Type WebServiceType) Public override object GetInitializer(LogicalMethodInfo methodInfo, SoapExtensionAttribute attribute) Public override Stream ChainStream( Stream stream ) Save the Stream representing the SOAP request or SOAP response into a local memory buffer. Public class TraceExtension : SoapExtension Here is a C# sample adapted from the SOAP Extension sample code at Microsoft MSDN Add the SOAP extension assembly as reference and declare the SOAP extension on the XML Web service reference of our application NET class library project in the language of your choice and add the SOAP extension.Ģ. Here are the steps to implement a SOAP Extension:ġ. ![]() SOAP extensions is a Microsoft ASP.NET WebMethod interception mechanism that can be used to manipulate SOAP requests/responses before they are sent on the wire. If you make direct SOAP requests, you need to use SOAP extension to log your requests and responses.
0 Comments
Leave a Reply. |