tags:

views:

123

answers:

1

Hello, I'm trying to implement a SoapExtension for log purposes (print the xml soap request) on an .NET 2.0 client application (not ASP.NET). I first tried a simple console application just to check and I'm not able to see that the extension is called. The simple code is just two lines:

System.Net.WebRequest request = System.Net.WebRequest.Create("http://www.ynet.com"); WebResponse response = request.GetResponse();

and my config file is the following:

What I'm doing wrong? are the extension usable only in ASP.NET? Thanks

A: 

You must have class e.g.:"YourExtension" derived from "SoapExtension" class and attribute class e.g. "YourExtensionAttribute" derived from "SoapExtensionAttribute" there you overide "Type" property:

public override Type ExtensionType
{
 get { return typeof(YourExtension); }
}

and put SoapExtensionAttribute to your webservice method

Jan Remunda
Hi,I've created my SoapExtension. I've read that instead of using the attribute, you can add what I've add in the config file. If I call a service added by a web reference it works fine, but if I use a WebRequest or HTTPWebRequest it does not work...