WCF LOB Adapter Usage Patterns
An adapter built using WCF LOB Adapter SDK can be used in variety of topologies and scenarios. Follow your organization’s n-tier architecture principles and design patterns to determine where the adapter can fit best for your requirements.
Usage Pattern 1 – Consume adapter in a .NET managed application (Point-to-Point)
Design Time: In Visual Studio 2005, use in project templates such as Windows Application, Class Library and Console Application.
At design-time, use Add Adapter Service Reference Visual Studio Plug-In to generate the WCF Client Proxy for use in the .NET application.
At design-time, use Add Adapter Service Reference Visual Studio Plug-In to generate the WCF Service Interface (callbacks) for use in .NET application.
Usage Pattern 2 – Consume adapter in BizTalk Server using BizTalk WCF Adapter (Broker, Bus)
Design Time: In Visual Studio 2005, use in project templates such as BizTalk Server Project. Please note that this scenario is only applicable to BizTalk Server 2006 R2, since versions prior to R2 do not have support for WCF.
At design-time, use Consume Adapter Service BizTalk Project Add-In to generate the XML Schema for input and output messages. The Consume Adapter Service BizTalk Project Add-In tool also generates a BizTalk Port Binding Configuration XML File that can be used to configure physical send port(s) at deployment time.
At design-time, use Consume Adapter Service BizTalk Project Add-In to generate the XML Schema for input and output messages. The Consume Adapter Service BizTalk Project Add-In tool also generates a BizTalk Port Binding Configuration XML File that can be used to configure physical receive port(s) / locations at deployment time.
Usage Pattern 3 – Consume adapter in a Windows Workflow Foundation (WF)
Windows Workflow Foundation (WF) provides a general framework for defining workflows and a robust runtime engine that allows you to host and interact with the running workflows. WCF provides a general framework for building connected systems and defining communication between two endpoints. With WCF LOB Adapter, you can use the consistent WCF API to access the line-of-business systems in the business processes within your environment. WF allows you to model and encapsulate your business logic and process, while WCF provides you with messaging infrastructure that gives you ability to distribute your systems. WF is a lightweight component (compared to BizTalk Orchestration) that runs within your application's or component's process.
Note to adapter developers: Workflows will execute asynchronously to the service call, so design appropriately when thinking about returning data from the adapter.
Usage Pattern 4 – Consume adapter in a Web Application
Design Time: In Visual Studio 2005 SP1, use in project templates such as ASP.NET Web Application and ASP.NET Web Site.
According to enterprise architecture guidelines and solution patterns, accessing data from target systems is usually in a separate data access layer. Add Adapter Service Reference Visual Studio Plug-In tool can be used to generate a Common Lanuage Runtime (CLR) WCF Client Proxy to access data from line-of-business target systems.
Usage Pattern 5 – Consume adapter in a Web Service
Design Time: In Visual Studio 2005 SP1, use in project templates such as ASP.NET Web Service, WCF Service and WCF Service Library
In the standard Web Service development cycle, start with either top-down, bottom-up or combination of web service design and use the WCF LOB Adapter to access data from a line-of-business target system. This is especially useful if you are building a Composite Web Service or a workflow using WF that will be deployed as service for integration with other client applications.
If you are -
Building a Web Service (using top-down approach) or
Hosting a workflow as a WCF Service or
Publishing a BizTalk Orchestration as a Web Service
AND there is a need to access data from a line-of-business system within these services, you still need some access mechanism to talk these target system. WCF LOB Adapter can be used to access the data from line-of-business system.
Usage Pattern 6 – Expose the proxy generated from adapter as a Web (WCF) Service hosted in IIS
The WCF LOB Adapter runs 'in-proc' in a client process. If there is a need to access the proxy over the internet using SOAP, the proxy class can be surfaced as a WCF service and hosted in a Web Server.
To accomplish this, you need to create a WCF Service Web Site project and add -
1. .Svc File: This should point to the service implementation class. The "proxy" generated from the adapter contains a service interface and classe that implements this interface. This class can be used as the "service implementation" CLR class in .svc. This file functions very similar is very similar to an .asmx file in classic ASMX web service. It gets placed in the virtual diractory under IIS and is used to identify the code behind the service and the class.
2. Web.Config: This will contain the service endpoint information, where the address is where this service will be hosted, binding is one of the HTTP bindings, contract is the interface generated from the adapter and the service implementation points to the class that implements the interface. The client endpoint information is still needed to communicate with the line-of-business. For the client endpoint, the address contains the location of the line-of-business system, binding is the adapter binding and contract is the interface generated from the adapter. The client endpoint is generated by Add Adapter Service Reference Visual Studio Plug-In.
3. Service Interface and CLR Class: Add Adapter Service Reference Visual Studio Plug-In generates these after the adapter consumers has browsed/searched the metadata hierarchy and selected a few methods of choice.
In current release, it takes a few manual steps to configure, host and publish a line-of-business system proxy generated from the adapter as a WCF Service. Also, special consideration is required for passing the line-of-business Client Credentials to the adapter (can be done using WCF behaviors). A future release of WCF LOB Adapter SDK will include tooling to automate these steps.
Usage Pattern 7 – Consume adapter in Microsoft Office SharePoint Server 2007
One of the major ways to connect to the data and existing applications from Office Applications is through the Business Data Catalog (BDC), a new integration feature in Microsoft Office SharePoint Server (MOSS) 2007. It is shared service and it surfaces business data from back-end data and applications without any coding. BDC is a metadata repository that defines business entities like customers, invoices and purchase orders. Once defined, these entities can be used by the clients. The BDC provides built-in support for displaying data from line-of-business (LOB) applications via databases and Web Services.
Until BDC provides native support for WCF (it is scheduled for a later release), the workaround is to follow the Usage Pattern 6 (substitute Basic Profile Intenet Client with BDC) to expose the data from WCF LOB Adapter as a Web Service. BDC can then integrate with this Web Service. The extra data (de) serialization can be avoided if the WCF LOB Adapter binding can be hosted 'in-proc' with BDC.