web-serviceswshttpbindingbasichttpbinding

When to utilize WSHttpBinding in compariosn with BasicHttpBinding


I am just getting started with SOAP web services and stumbled across WSHttpBinding and BasicHttpBinding.

I'd like to know 2 things based on following use case:

Suppose, there is web service which accepts country name as request and returns state list as response.

What are the pro's and con's of WSHttpBinding or BasicHttpBinding on the basis of my simple use case above?


Solution

  • Citing WCF Soap Rest WSHTTPBinding

    Between basicHttpBinding and wsHttpBinding, there differences are as follows:

    basicHttpBinding is the very basic binding - SOAP 1.1, not much in terms of security, not much else in terms of features - but compatible to just about any SOAP client out there --> great for interoperability, weak on features and security

    wsHttpBinding is the full-blown binding, which supports a ton of WS-* features and standards - it has lots more security features, you can use sessionful connections, you can use reliable messaging, you can use transactional control - just a lot more stuff, but wsHttpBinding is also a lot *heavier" and adds a lot of overhead to your messages as they travel across the network

    Put simply WsHttpBinding supports the WS-* specification. The WS-* specifications are standards extending web service capabilities. ANother big difference is that Basic sends data in plain text by default wherein WS supports security and encryption.

    As to your use case, if you are a very security conscious individual and coder as we all should strive to be and your country and states web services should be secured - it may be a good idea to use WSHTTPBinding but IMHO that will lock you into WCF and .Net. If you do want to go that route and utilize WS and WCF, this SO article explains how to modify the binding settings for interop wshttpbinding is only for .net clients?