In real world , web service of WCF in basichttpbinding might not be flexible enough to meet enterprise application requirements.
What programmers are looking at is a more robust way of developing web service application in WCF. CustomBinding as the name describes that it alllows users design their own web service binding.
At the point, people might think it will lose the captibilities of interoperabilities provided by basichttpbinding.

In fact, a custombinding can easily emulate basichttpbinding for your service contracts.
Moreover, the custombinding emulating basichttpbinding makes the basichttpbinding more configurable.
For example, you can change the threshold values of ClockSkew which is 5 mins in basichttpbinding. Here we have an example.

A BasicHttpBinding with UserName authentication in SOAP header within request message over HTTPS transport.

<basicHttpBinding>
    <binding name=“mySecureBasicHttpBinding”>
      <security mode=“TransportWithMessageCredential”>
        <transport clientCredentialType=“None” />
        <message clientCredentialType=“UserName” />
      </security>
    </binding>
  </basicHttpBinding>

Equivalent CustomBinding of BasicHttpBinding above with more controls from configuration point of view.
The customBinding below was designed in a way of fulfilling the specifications built in the basicHttpBinding.

<customBinding>
    <binding name=“myCustomBindingForEmulatingSecureBasicHttpBinding”>
      <security authenticationMode=“UserNameOverTransport”>
        <localClientSettings maxClockSkew=“00:30:00″/>
        <localServiceSettings maxClockSkew=“00:30:00″/>
      </security>
      <textMessageEncoding messageVersion=“Soap11″ />
      <httpsTransport />
    </binding>
 </customBinding>

If client application were generated and pointing to a service endpoint configured with the first example i.e. mySecureBasicHttpBinding,
it would still work if the client pointed to the service endpoint configured with the binding in the second example i.e. myCustomBindingForEmulatingSecureBasicHttpBinding ( with maxClockSkew configured )

PS: One service contract can be exposed by one or many endpoints with different bindings. In this case, two service endpoints can be configured to use both
mySecureBasicHttpBinding and myCustomBindingForEmulatingSecureBasicHttpBinding.

Tags: , , , ,

Leave a Reply

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>