I need to use a SoapExtension
subclass (which I have created), but it seems that this class can only be initialized through a web.config
file. I ha
I found out how to / where to insert the web.config
content in the app.config file:
I had to insert it after ApplicationSettings
and userSettings
elements. This is the only place where it doesn't generate any error at runtime. So no need for a web.config file, although I still would like to know how to configure the app, if someone has the answer.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
</configSections>
<applicationSettings>
</applicationSettings>
<userSettings>
</userSettings>
<system.web>
<webServices>
<soapExtensionTypes>
<add type="MyNameSpace.MySoapExtension,MyAssemblyFileName" priority="1"/>
</soapExtensionTypes>
</webServices>
</system.web>
<system.serviceModel>
<bindings />
<client />
</system.serviceModel>
</configuration>
My SoapExtension seems to be correctly initialized now, and the message filtering works fine.
Related to @soleshoe's comment I couldn't get my Unit tests (XUnit) to work, my App.config looked like this in the end.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
</configSections>
<system.web>
<webServices>
<soapExtensionTypes>
<add type="System.Common.SOAPExtensions.TraceExtension, System.Common" priority="1"/>
</soapExtensionTypes>
</webServices>
</system.web>
</configuration>