Web Service Bindings
Web services make it easy to expose system functionality to remote clients. For one, web services are typically exposed over HTTP or HTTPS through ports that administrators allow to be open. More importantly, web services provide an interoperable way to communicate using standards such as SOAP, WSDL, and XML, making them the ideal conduit for communication between trading partners, independent systems, and heterogeneous environments.
Several of the standard WCF bindings can be used to expose web services, including
BasicHttpBinding
, WSHttpBinding
, WSDualHttpBinding
, and
WSFederationHttpBinding
. BasicHttpBinding
supports SOAP 1.1 by default, whereas the other three bindings
default to SOAP 1.2 with support for WS-Addressing among other protocols.
This section will focus on the fundamental web service bindings, BasicHttpBindng
and WSHttpBinding
. The first thing you’ll do is complete a lab that exercises each
binding. After the lab, I’ll explain the following concepts:
Binding features and their applicability to these bindings
Scenarios in which each binding is appropriate
MessageVersion
settingsSerialization differences for SOAP 1.1 and SOAP 1.2
Alternatives for exposing a single service over two bindings
Lab: Exposing Web Services with BasicHttpBinding and WSHttpBinding
In this lab, you’ll exposed web service endpoints for a service that lets users upload photos and save a record of each upload to a database. You’ll provide endpoints for SOAP 1.1 and SOAP 1.2 with WS-Addressing ...
Get Learning WCF now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.