I have working WCF service where I need to add some functionality regarding authorization. I have have created class which inherits from ServiceAuthorizationManager
and successfully added it in app.config
. It's working properly.
I also need to implement class which implements IDispatchMessageInspector
, so I could do some message validation.
I have followed many examples like this, this, this, this, this and some others. Also questions in SO like this.
They all seem to have same configuration in app.config
file. However, when I try that and run code, it seems that class implementing IDispatchMessageInspector
is never being called when I debug. I've added break points, but they are never being hit.
Am I missing something obvious?
<extensions>
<behaviorExtensions>
<add name="MessageInspectorBehaviourExtension" type="MultipleEndpoints.MessageInspectorBehaviourExtension, RL_Managed_Service" />
</behaviorExtensions>
</extensions>
<behaviors>
<serviceBehaviors>
<behavior name="RLServiceBehavior">
<serviceDebug includeExceptionDetailInFaults="False"/>
<serviceAuthorization serviceAuthorizationManagerType="MyProject.Services.AuthorizationService,MyProject"/>
<MessageInspectorBehaviourExtension />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="RLServiceBehavior" name="MultipleEndpoints.RL_Managed_Service">
<endpoint address="" binding="basicHttpBinding" contract="MultipleEndpoints.container_db_ops" bindingConfiguration="TransportSecurity"/>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
<host>
<baseAddresses>
<!-- --><add baseAddress="http://localhost:49224/My_Service/"/>
</baseAddresses>
</host>
</service>
</services>