In my current project I need to call a web service over https. Security is implemented by using a custom header (old school). To support this in WCF follow the following simple steps:
In the configuration file (app.config) make the following changes:
<client>
<endpoint address=”https://…”
binding="basicHttpBinding" bindingConfiguration="MyHttpsBinding"
contract="…" name="ACC">
<headers> <!—your custom header here –>
<credentials >
<username>…</username>
<password>…</password>
</credentials>
</headers>
</endpoint>
</client>
Add a new binding:
<binding name="MyHttpsBinding">
<security mode="Transport">
<transport>
<extendedProtectionPolicy policyEnforcement="Never" />
</transport>
</security>
</binding>