Architecture overview of BizTalk Adapter for SQL Server
The Microsoft BizTalk Adapter for SQL Server is a Windows Communication Foundation (WCF) custom binding. This binding contains a single custom transport binding element that enables communication with a SQL Server database. The SQL adapter is wrapped by the Microsoft Windows Communication Foundation (WCF) Line of Business (LOB) Adapter SDK run time and is exposed to applications through the WCF channel architecture. The SQL adapter communicates with the SQL Server database through ADO.NET.
The following figure shows the end-to-end architecture for solutions that are developed by using the SQL adapter.
Consuming the Adapter
The SQL adapter exposes the SQL Server database as a WCF service to client applications. To perform operations and access data on the SQL Server database, client applications exchange SOAP messages with the SQL adapter through WCF channels. The preceding figure shows four ways in which the SQL adapter can be consumed.
Through a WCF channel model application. A WCF channel model application performs operations on the SQL Server database by using the WCF channel model to exchange SOAP messages directly with the SQL adapter. See Develop SQL applications using the WCF Channel Model.
Through a WCF service model application. A WCF service model application calls methods on a WCF client to perform operations on the SQL Server database. A WCF client models the operations exposed by the SQL adapter as .NET methods. You can use the Microsoft Windows Communication Foundation (WCF) Line of Business (LOB) Adapter SDK or the WCF ServiceModel Metadata Utility Tool (svcutil.exe) to create a WCF client class from metadata exposed by the SQL adapter. See Develop SQL applications using the WCF Service model.
Through a BizTalk receive location or send port that is configured to use the Microsoft BizTalk WCF-Custom adapter. The WCF-Custom adapter enables the use of WCF extensibility features. By using the WCF-Custom adapter you can select and configure the SQL DB Binding and the behavior for the receive location or send port. For more information about how to use the SQL adapter in BizTalk Server solutions, see Developing BizTalk Server Applications.
Through an IIS-hosted Web service. In this scenario, a WCF service proxy generated by using the adapter is hosted in IIS using the standard WCF Http Binding. This exposes the service contract as a Web service to external users. IIS automatically hosts the adapter at run time, which, in turn, communicates with the SQL Server database.
The SQL Adapter and WCF
WCF presents a programming model based on the exchange of SOAP messages over channels between clients and services. These messages are sent between endpoints exposed by a communicating client and service. An endpoint consists of:
An endpoint address, which specifies the location at which messages are received.
A binding, which specifies the communication protocols used to exchange messages.
A contract, which specifies the operations and data types exposed by the endpoint.
A binding consists of one or more binding elements that stack on top of each other to define how messages are exchanged with the endpoint. At a minimum, a binding must specify the transport and encoding that are used to exchange messages with the endpoint. Message exchange between endpoints occurs over a channel stack that is composed of one or more channels. Each channel is a concrete implementation of one of the binding elements in the binding configured for the endpoint.
The WCF documentation includes more details about WCF, and the WCF programming model.
The Microsoft BizTalk Adapter for SQL Server exposes a WCF custom binding, the SQL DB Binding (Microsoft.Adapters.SQLDB.SQLDBBinding). By default, this binding contains a single custom transport binding element, the SQL DB Adapter Binding Element (Microsoft.Adapters.SQLDB.SQLDBAdapter), which enables operations on a SQL Server database.
Microsoft.Adapters.SQLDB.SQLDBBinding (the SQL DB Binding) and Microsoft.Adapters.SQLDB.SQLDBAdapter (the SQL DB Adapter Binding Element) are public classes and are also exposed to the configuration system. Because the SQL DB Adapter Binding Element is exposed publicly, you can build your own custom WCF bindings capable of extending the functionality of the SQL adapter. For example, you could implement a custom binding to support Enterprise Single Sign-on (SSO) in a WCF channel or service model solution. The reasons for doing this would be to aggregate database operations into a single multifunction operation or to perform schema transformation between operations implemented by a custom application and operations on the SQL Server database.
The SQL adapter is built on top of the Microsoft Windows Communication Foundation (WCF) Line of Business (LOB) Adapter SDK, and runs on top of the WCF LOB Adapter SDK run time. The WCF LOB Adapter SDK provides a software framework and tooling infrastructure that the SQL adapter uses to provide a rich set of features to users and adapter clients.
SQL adapter and the WCF LOB Adapter SDK
The Microsoft BizTalk Adapter for SQL Server implements a set of core components that leverage functionality provided by the Microsoft Windows Communication Foundation (WCF) Line of Business (LOB) Adapter SDK and provide connectivity to the SQL Server database through ADO.NET.
The WCF LOB Adapter SDK serves as the software layer through which the SQL adapter interfaces with the Windows Communication Foundation (WCF); ADO.NET serves as the layer through which the SQL adapter interfaces with the SQL Server database. The following figure shows the relationships between the internal components of the SQL adapter and between these components and ADO.NET.
The SQL adapter connects with the SQL Server database through ADO.NET. ADO.NET provides consistent access to data sources such as SQL Server, and facilitates retrieval, handling, and modification of the data in the data sources. Read more about ADO.NET.
The SQL client provides connectivity to the SQL Server database. You establish a connection to a SQL Server database by providing a connection URI to the SQL adapter. This connection URI contains the name of the computer on which the SQL Server is installed and the name of the database. For more information about the connection URI, see Create a connection to SQL Server.