65.9K
CodeProject is changing. Read more.
Home

WCF Binding Box: Converting WsHttpBinding to a Custombinding

starIconstarIconstarIconstarIconstarIcon

5.00/5 (2 votes)

Apr 10, 2010

CPOL
viewsIcon

34762

WCF Binding Box WCF Binding Box (online)Introduction Those of you who have worked with WCF can testify that: WCF configuration is hard. WCF security configuration is hard.After a while you get used to BasicHttpBinding or WSHttpBinding. But then comes a service which...

wcf binding box WCF Binding Box

WCF Binding Box (online)

Introduction Those of you who have worked with WCF can testify that:
  • WCF configuration is hard.
  • WCF security configuration is hard.
After a while you get used to BasicHttpBinding or WSHttpBinding. But then comes a service which requires some special tweak which is not available in the pre-defined bindings. For example, omitting the timestamp or increasing any of the timeout intervals. In such cases you should turn to a customBinding. But how are you going to get a custom binding which is equivalent to your original one? WCF Binding Box The Wcf Binding Box is an online WCF binding converter. You supply it with your current binding and it returns you an equivalent custom binding. All you need to do is: 1. Paste your binding. For example:
<bindings>
    <wsHttpBinding>
        <binding name="MyBinding">
            <security>
               <message clientCredentialType="UserName" />
            </security>
        </binding>
     </wsHttpBinding>
</bindings>
2. Click the "Convert to Custom Binding!" button. 3. Use the result binding in your code:
<customBinding>
    <binding name="NewBinding0">
        <transactionFlow />
        <security authenticationMode="SecureConversation" 
messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10">
            <secureConversationBootstrap authenticationMode="UserNameForSslNegotiated" 
messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10" />
        </security>
        <textMessageEncoding />
        <httpTransport />
    </binding>
</customBinding>
More Information Wcf Binding Box introduction WCF Blog The Author Yaron Naveh (email) is a web services interoperability expert.
His blog contains information about interoperability of various frameworks (WCF, WSE, WSIT, Axis2...) and deals with web services security, performance and testing.