locked
<soapExtensionTypes> issue RRS feed

  • Question

  • User1289727702 posted
    I am trying to write soap extension to save the soap message to a file. The class is derived from SoapExtension. It is working absolutely fine when I put the SoapExtension classname as attribute in my WebMethod. But I cannot modify my wen service to include soap extensions.

    I tried to do it by adding <soapExtensionTypes> in Web.config but am unable to do so. here's a high level view of my code:

    using localhost;

    static void Main(string[] args)
    {
    Service1 obj = new Service1();
    string value = obj.HelloWorld("User"); //Returns Hello User!!!
    }

    My web.config looks like:

    <system.web>
    <webServices>
    <soapExtensionTypes>
    <add type="localhost.NameSpace.MyExtensionClass" priority="10" group="Low"/>
    </soapExtensionTypes>
    </webServices>
    </system.web>

    It gives me error:

    The value of the property 'type' cannot be parsed. The error is: Could not load type 'localhost.NameSpace.MyExtensionClass'. I know that the value of type is not correct. What should be the correct value of type?
    Thursday, April 16, 2009 12:43 PM

All replies

  • User1071970124 posted

     It looks like you're trying to use the SoapExtension in your client. Is that correct? If so, then clearly, the SoapExtension needs to exist on the client, and does not.

    You'll need to put it into an assembly that can be shared between the client and the service, then you'll need to make sure each client has that assembly. You'll then have to reference that assembly in the <soapExtensionTypes> <add/> element.

    Saturday, May 2, 2009 9:22 PM
  • User-149761390 posted

    You must have implemented a class that extends SoapExtension,
    Look at this link, there is an example of how, well detailed.

    http://www.systemdeveloper.info/2013/11/trace-soap-requestresponse-xml-with.html

    Friday, April 4, 2014 10:24 AM