Skip to content
Allows injection of custom headers into a WCF endpoint.
C#
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Builds/V1.0.0.0
WcfHeaderInjection
.gitignore
LICENSE
README.md
WcfHeaderInjection.sln

README.md

WCF Header Injection Endpoint Behavior

Allows injection of custom headers into a WCF client endpoint.

Add the following to <system.serviceModel>. Any headers you wish to add should be placed under the headerInjection element. The dll itself should generally be placed in the same folder as your WCF client.

<extensions>
  <behaviorExtensions>
    <add name="headerInjection" type="WcfHeaderInjection.EndpointBehaviorExtension, WcfHeaderInjection, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
  </behaviorExtensions>
</extensions>

<behaviors>
  <endpointBehaviors>
    <behavior name="MyServiceBehaviour">
      <headerInjection>
        <add key="HeaderKey" value="HeaderValue" />
        <add key="UserAgent" value="MyApp (Windows 2012)" />
      </headerInjection>
    </behavior>
  </endpointBehaviors>
</behaviors>

<client>
  <endpoint address="..." behaviorConfiguration="MyServiceBehaviour" name="MyService" />
</client>
You can’t perform that action at this time.