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!!!
}
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?
AJ Please don't forget to click “Mark as Answer” on the post that helped you.
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.
ashishnjain
Member
168 Points
98 Posts
<soapExtensionTypes> issue
Apr 16, 2009 04:43 PM|LINK
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?
Please don't forget to click “Mark as Answer” on the post that helped you.
johnwsaunder...
Star
11262 Points
1981 Posts
Re: <soapExtensionTypes> issue
May 03, 2009 01:22 AM|LINK
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.