I was working on a project where there was some WCF involved.
As you know, there are many different kind of bindings such as wsHttpBinding and ws2007HttpBinding. Each binding is basically the instructions to on how to configure the system to work in a certain way.
Now the fun part of this particular project is that we needed to configure something that was not directly configurable on ws2007HttpBinding. I knew it was possible to modify it but couldn’t pinpoint where in the web.config file.
CustomBindings are basically bindings where you get to configure everything. That’s fun but how do you replicate using a CustomBinding something that exists, for example in ws2007HttpBinding.
I found this wonderful little site called WcfBindingBox.
What it let’s you do is paste in what your binding looks like and will give you the equivalent using a CustomBinding.
Here is an example, pasting in :
<bindings> <wsHttpBinding> <binding name="MyBinding"> <security> <message clientCredentialType="UserName" /> </security> </binding> </wsHttpBinding> </bindings>
Will give you this :
<!-- generated via Yaron Naveh's http://webservices20.blogspot.com/ --> <customBinding> <binding name="NewBinding0"> <transactionFlow /> <security authenticationMode="SecureConversation" messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10"> <secureConversationBootstrap authenticationMode="UserNameForSslNegotiated" messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10" /> </security> <textMessageEncoding /> <httpTransport /> </binding> </customBinding> <!-- generated via Yaron Naveh's http://webservices20.blogspot.com/ -->
Neat !

Leave a comment