1

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?

JGlass
  • 1,427
  • 2
  • 12
  • 26
ofortuna
  • 187
  • 2
  • 17

1 Answers1

1

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?

Community
  • 1
  • 1
JGlass
  • 1,427
  • 2
  • 12
  • 26
  • so if i develop my sample use case web service in .net with security then i have to use wshttpbinding? if i do not use any extra feature then i use basichttpbinding. and if i develop the web service in java then i can not use wshttpbinding or basic HTTP binding. is it so? – ofortuna Feb 01 '18 at 15:29
  • Initially it looked like you had to use the BasicHTTPBinding if the web service is in .Net and Java is a consumer but this appears to say differently [WSHTTPBinding is only for net clients](https://stackoverflow.com/questions/12452699/wshttpbinding-is-only-for-net-clients]) and you just need to edit the wsHttpBinding->binding->security mode attribute. On the second question, yes if you dont care of any of the other features use the basic as less overhead. If doing everything in Java - then you can go with WS-Security – JGlass Feb 01 '18 at 15:44
  • so if i have a java client which is consuming wshttpbinding enabled .net web service then it is not possible. is it so? – ofortuna Feb 01 '18 at 15:48
  • It does look like it will be possible if you adjust the wsHttpBinding->binding->security mode attribute. XML elements which are likely in the web.xml/app.xml files – JGlass Feb 01 '18 at 15:49
  • Thank you @Ofortuna for think my answers are helpful and useful! – JGlass Feb 01 '18 at 16:00