The BizTalk Connectivity Service is one of BizTalk Services available for building Internet-enabled applications. It allows you to expose a service to the Internet that is located behind network address translation (NAT) boundaries and/or are bound to frequently changing, dynamically assigned IP addresses.

The Connectivity Service offers two core features to applications: the ability to create a listening WCF endpoint at the connectivity service and the ability to send messages to and from that endpoint.

In order to create a listening endpoint, an application requests to listen on a particular public address. If that address is available and the user is authorized, the Connectivity Service will start listening on that address on behalf of the application.  When messages are sent to that public address, the Connectivity Service will forward them to the application. In this way, the messages are “relayed” through the connectivity service to enable client-service communication without the need to implement network-traversal logic.

BizTalk Connectivity Service allows for numerous connection modes between senders and receivers that determine how the connection to BizTalk Connectivity Service is made. To establish the connection a new WCF Binding has been defined: RelayBinding.

The different connection modes the allowed by the RelayBinding are:

  • RelayedOneWay

The connection is set up to accept or send one-way operations only. To use this setting, all methods on your service contract must have an OperationContractAttribute with its IsOneWay property set to true. While one-way messages can also be sent using RelayedDuplex connection mode, this connection mode is more efficient for one-way protocols.

  • RelayedDuplex

The connection is set up to support request-reply contracts (including duplex contracts). Configures the binding to use CompositeDuplex which will create separate channels for incoming and outgoing messages.

  • RelayedDuplexSession

Same as RelayedDuplex but configured to enable end-to-end WS-ReliableMessaging sessions. This is the default connection mode.

image

  • DirectDuplexSession

Configures the binding to initiate a direct connection between the client and the service. This mode is an optimization of RelayedDuplexSession in that it attempts to bridge a direct connection between the sender and receiver if possible. If it cannot, it will fall back to relaying the traffic.

image

  • RelayedMulticast

This mode enables a publish/subscribe communication pattern (or multicast messaging pattern) over WCF, which isn’t available from any of the build-in WCF bindings. RelayedMulticast connection mode allows multiple applications to subscribe to messages sent to an endpoint. Any messages sent to that endpoint are received by all applications.

Multiple listeners are allowed to be registered at a URI when multicast connection mode is specified by the first listener. Each service host that has an endpoint listening on that same URI implicitly becomes a subscriber. When a client sends a message to that URI, the message is delivered to all service endpoints currently subscribed.

image

  • RelayedHttp

This mode allows the service to be discoverable at an HTTP listen Uri (Web-style messaging). It configures the binding to emulate the behavior of HttpTransportBinding Element. In this way you are using BizTalk Connectivity Services to relay the HTTP traffic to your local service and you can use the HttpRequestMessageProperty and HttpResponseMessageProperty to access the HTTP method, headers, and status-code.

Watch out for BizTalk Services new Feature - BizTalk Workflow Services: the ability to orchestrate services from the clouds (across the Internet Services Bus).