All versions of BizTalk Server use a publish/subscribe messaging engine architecture. In a publish/subscribe architecture, all messages that flow through BizTalk Server are first published to the MessageBox database and subsequently picked
up by Send Ports, Receive Ports, or Orchestrations that are decorated with matching subscription information. One of the primary advantages of a publish/subscribe architecture is that receiving of messages is loosely coupled from sending of messages and messages
can be published even if there are no subscribers available to process messages when they are published. Other advantages include the ability to track message properties, messages bodies, and to resubmit messages that initially failed delivery to subscribers.
Figure 1 - BizTalk Server Publish Subscribe architecture
This document provides .NET/WorkFlow developers with techniques for utilizing AppFabric and BizTalk Server 2010 together to develop low latency connectivity solutions to LOB systems. Such solutions allow front end applications built
on ASP.NET, SharePoint, or Web Services to exchange messages with multiple backend systems and respond to user initiated requests quickly.
This whitepaper provides information on using BizTalk Server and WF/WCF together by illustrating to BizTalk and Workflow developers how to combine functionality from both in a Visual Studio 2010 project. The project is a simple workflow
that leverages the BizTalk Server Mapper and LOB Adapter functionality.
Because this project does not use the BizTalk Messaging Engine it will provide improved latency over a pure BizTalk Server solution while still utilizing BizTalk Server functionality.
Since Visual Studio 2010 can access the BizTalk Mapping and WCF LOB connectivity APIs, this whitepaper also illustrates how WorkFlow developers can now access BizTalk Mapper functionality to implement document transformations and complete
WCF LOB connectivity without having to first configure a BizTalk Server environment.
The following users should read this guide:
All software was installed on a single machine using the steps provided at
Installing the BizTalk Server 2010 AppFabric Connect feature on a developer computer (http://social.technet.microsoft.com/wiki/contents/articles/installing-the-biztalk-server-2010-appfabric-connect-feature.aspx#InstDev). For purposes of this walkthrough,
Optional components were installed.
This section provides a walkthrough of using Visual Studio 2010 with BizTalk Server 2010 and the BizTalk Adapter Pack to develop a simple WCF solution which uses the WCF SQL Adapter to retrieve some records from the "Customers" table
in the "NorthWind" database, apply a simple map to the selected records, and then update a modified version of the "Customers" table ("Customers2") in a modified version of the "Northwind" database ("Northwind2"). To build and run the solution, follow these
After installing all software, download the scripts to install the NorthWind database on your SQL Server instance from
Note Ensure that your user account is member of the serveradmin role on this instance of SQL Server.
After following the instructions to install the NorthWind database on your SQL Server instance, paste the following script into the SQL Query Editor to add a "Customers2" table to the NorthWind database:
/****** Object: Table [dbo].[Customers2]******/
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
CREATE TABLE [dbo].[Customers2](
[CompanyName] [nvarchar](100) NOT NULL,
[Address] [nvarchar](100) NULL)
Figure 2 – Visual Studio 2010 New Project Dialog Box
Figure 3 – Visual Studio 2010 Service1.xamlx as viewed in Designer
Verify that the Add Adapter Service Reference dialog box is populated with the following values and click the
Figure 4 – Visual Studio 2010 Add Adapter Service Reference dialog box
Note If you installed the BizTalk Adapter Pack 2.0 on a 64-bit machine and you received the error message "No valid adapters installed on the machine", then ensure that the 32-bit version of the BizTalk Adapter Pack 2.0 is also installed. Both the
64-bit and 32-bit versions of the BizTalk Adapter Pack 2.0 are available for download at
In the Solution Explorer, right-click the WCF_BTS_APP project and select
Build from the context menu. After building this project with the new adapter service references the Visual Studio 2010 toolbox should expose two additional tabs;
mssql:TableOp_dbo_Customers and mssql:TableOp_dbo_Customers2. The mssql:TableOp_dbo_Customers tab will expose a
SelectActivity and the mssql:TableOp_dbo_Customers2 tab will expose an
Figure 5 - Visual Studio 2010 Toolbox Tabs added after adding SQL Adapter service references
Figure 6 - Sequence shape with Receive shape, SelectActivity shape and InsertActivity shape as viewed in the Designer
These activities are visual representations of the logic that will be used to select records from the Customers table in the NorthWind database and after performing a BizTalk mapping operation on the selected records, insert the result set into the Customers2
table in the NorthWind database. Before we can apply any operations to the selected data or insert the result set we must first define a query for the select activity, and define variables to contain both the selected data as input into a BizTalk map as well
as the data that is output from the BizTalk map.
After creating the variables data1 and data2 the Designer should look as follows:
Figure 7 – Variables defined in the Visual Studio 2010 Designer
After creating variables apply properties to the SelectActivity and InsertActivity items as follows:
Right-click to select the
SelectActivity item in the Visual Studio Designer and select
Properties from the context menu. Enter the following values for the SelectActivity item properties:
Follow these steps to add a BizTalk Map to the WCF_BTS_APP project:
Figure 8 – New map surface displayed in Visual Studio
Figure 9 – Map connecting input schema to output schema
Complete the following steps to publish the WCF_BTS_APP project to IIS:
Figure 9 – Publish Web dialog box displayed in Visual Studio
To create a console application to test the published WCF Service and verify that the WCF SQL Adapter is updating the NorthWind database as expected, follow these steps:
Any idea why I am missing : "Add Adapter Service Reference" when I right click on project level (under item 10 Create the WCF Solution and a WCF Workflow Service Application in Visual Studio 2010). Iam running Windows 7 Home Premium edition and VS2010 Pofessional. Thanks for your suggestions.
IIRC, the "Add Adapter Service Reference" functionality is provided when you install the The WCF LOB Adapter SDK SP2, which can be downloaded from go.microsoft.com/fwlink. Can you verify that the WCF LOB Adapter SDK SP2 is installed on your computer?
I can confirm you that the WCF Adapter SDK is installed on my computer. I followed the above steps and as mentioned under step 5 (of the prerequisites) installed this SDK. I am astonished not to see this back in my menu structure in VS2010. Are there possibly some setting(s) in VS that suppress this? Are there other ways to check this in VS2010? Thanks for helping out.
My bad, that should be WCF LOB Adapter SDK 2010, not the WCF LOB Adapter SDK SP2. The WCF LOB Adapter SDK 2010 is available for download from the BizTalk Server 2010 Beta page at go.microsoft.com/fwlink.
Nice article. Unfortunately, I cannot open http://localhost/WCF_BTS_APP/Service1.xamlx from Internet Explorer. The error I'm getting is "The page you are requesting cannot be served because of the extension configuration".
The page works from Visual Studio and the Publish was completed successfully.
Obviously, I need to add an extension handler for xamlx. What component do I need to add this extension handler? Did I miss a step?
Nice introduction to this technology. I used the AppFabricVM obtained from the two-day AppFabric training and installed the BizTalk components. Everything worked well and the example is helpful. Good work!
Nice article and very useful as background on article I wrote for Dutch .NET Magazine.
This is now featured on the front page of TechNet Wiki! Congratulations!
Nice article. I had already tried it once and works fine. Can this example be extended to AppFabric Service Bus? I'm trying to expose the Workflow Services endpoint over Service Bus, so thought it would be helpful if that scenario is covered in this article. Thanks much.