I need to use a SoapExtension subclass (which I have created) but it seems that this class can only be initialized throught a "web.config" file (Though I have read that it should be possible through "app.config" file - but I don't know how to do it that way). Problem : I have no web.config file in my project. So I created one manually with the following content :
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
<webServices>
<soapExtensionTypes>
<add type="MyNameSpace.MySoapExtension,MyAssemblyFileName" priority="1"/>
</soapExtensionTypes>
</webServices>
</system.web>
</configuration>
Despite breakpoints distpatched in each SoapExtension methods, nothing happens at runtime, it seems that it is never initialized nore called... (My SoapService initializes ok, but without any extension).
I guess that creating the web.config file manually may not be enough for it to be taken into account, so I am wondering how to properly configure my app to have a web.config file in order to use my SoapExtension (It should go and initialize my class, processMessage, and chainStream stuff...).
(Note: this is my first ever SoapExtension implementation, I am not really sure about what I am doing)
Related to @soleshoe's comment I couldn't get my Unit tests (XUnit) to work, my App.config looked like this in the end.
I found out how to (or indeed 'where to') insert the web.config content in the app.config file:
I had to insert it after 'ApplicationSettings' and 'userSettings' ; this is the only place where it doesnt generate any error at runtime (So no need for a web.config file - though i still would like to know how to configure the app, if someone has the answer...).
My SoapExtension seems to be correctly initialized now, the message filtering works fine.