0

I thought I was quite competent using web services (all web services I develop and use are on an Intranet), but I appear to take "bindings" for granted. I now have to use an external web service.

Is it the client application that chooses the binding? i.e. by using a "web reference"; basicHttp binding is used and by using a "Service Reference" wshttpbinding is used. This webpage seems to indicate that this is the case: http://www.codeproject.com/Articles/139787/What-s-the-Difference-between-WCF-and-Web-Services.

What happens if the web service (server side) does not specify the wshttpbinding in the web.config? Will the client side developer be prompted with an error if they attempt to add a Service Reference?

w0051977
  • 15,099
  • 32
  • 152
  • 329
  • The server decides on which bindings to offer. For .Net clients the svcutil will generate the appropriate binding for you based on the WSDL offered by the service. The binding dictates which WS-* or SOAP specs are used. Mismatches in binding expectations between client and server lead to all kind of errors. When you have to support non .Net clients start with a basichttpBinding. Adding another binding is config only (assuming you configure stuff in the config file). – rene Sep 03 '16 at 10:26
  • @rene, if a client adds a "service" reference then will wshttpbinding always be used? Thanks – w0051977 Sep 03 '16 at 10:29
  • No, it depends if the server advertises SOAP 1.1 or SOAP 1.2: http://stackoverflow.com/a/2107268/578411 – rene Sep 03 '16 at 10:34
  • @Rene, how do I know what version of SOAP I am using? – w0051977 Sep 04 '16 at 10:27
  • I normally check the namespaces that are generated in the WSDL to be sure but I believe basicHttpbinding is SOAP 1.1 and wsHttpBinding is SOAP 1.2 but you can create a custom binding to control different aspects of the binding that don't come by default with either the basic or ws binding. – rene Sep 04 '16 at 10:35

0 Answers0