I am trying to extend the behavior of my service endpoint with the help of a special MessageInspector, the extension works fine and is selected, but only if I do not define the "name" parameter in the behavior tag and do not define a specific configuration situation on the endpoint. This means that I am expanding all the endpoints, and that is what I do not want. Can someone explain to me what I'm doing wrong?
This configuration does not support the myBehaviour extension and is not interrupted.
<system.serviceModel> <services> <service name="testService"> <endpoint address="http://localhost:9999/TestServiceService" binding="wsHttpBinding" contract="ITestService " behaviorConfiguration="myBehaviour" /> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> </service> </services> <behaviors> <endpointBehaviors> <behavior name="myBehaviour"> <HeaderForwardExtension /> </behavior> </endpointBehaviors> </behaviors> <extensions> <behaviorExtensions> <add name="HeaderForwardExtension" type="Test.Service.HeaderForwardBehavior, Test.Service, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" /> </behaviorExtensions> </extensions> </system.serviceModel>
However removal
behaviorConfiguration="myBehaviour"
and changing the behavior tag so that the name is not
<behavior> <HeaderForwardExtension /> </behavior>
works great.
thanks
source share