Skip to main content

How to change default binding in WCF 4.0

With WCF 3.x, if you try to host a service without any configured endpoints, the ServiceHost instance will throw an exception informing you that you need to configure at least one endpoint. With WCF 4, this is no longer the case because the runtime automatically adds one or more “default endpoints” for you, thereby making the service usable without any configuration.
If you want to change default binding then open web.config and do following entry in <system.serviceModel>

<system.serviceModel>

<protocolMapping>

<add binding="basicHttpBinding" scheme="Http"/>

</protocolMapping>


</system.serviceModel>

Comments

Popular posts from this blog