다음을 통해 공유


Consume WCF Service Wizard generates port binding configuration files for import into BizTalk Server

Scenario: You have already designed, implemented and hosted a WCF Service. Now, you would like to send (and get) messages to this WCF Service in a BizTalk Orchestration process. BizTalk communicates with WCF applications via BizTalk WCF Adapter, which can be configured through send and receive ports in BizTalk. This post talks about how BizTalk’s Consume WCF Wizard can be used to simplify the port creation process in BizTalk, especially the need of mapping the operation(s) with the SOAP Action(s) within the port to invoke the operation in WCF Service.

Microsoft BizTalk Server 2006 R2 now includes a BizTalk WCF Adapter to provide support for WS-* and transport neutrality by letting the user choose most appropriate Windows Communication Foundation (WCF) binding in BizTalk Port configuration. The BizTalk WCF Adapter can be selected within a Send Port by creating a new port and then selecting a Transport Type. In Receive Port, the BizTalk WCF Adapter can be selected by creating a new Receive Location and then selecting Transport Type from the drop-down box. The Receive Location allows for hosting a non-HTTP WCF Service within BTSNtSvc.exe and can be enabled within the BizTalk Administration Console without need for publishing.

Even though WCF-Custom is the only adapter needed, BizTalk allows other WCF adapters for most common messaging scenarios, as shown in the table below. For example, WCF-Custom can be used as WCF-WSHttp transport by selecting WCF-Custom, clicking on Configure, select Binding tab and selecting the Binding Type wsHttpBinding or customize this transport by using wsDualHttpBinding or wsFederationHttpBinding.

Available Send Port

WCF Adapters

Available Receive Port

WCF Adapters

One-way

WCF-BasicHttp

WCF-Custom

WCF-NetMsmq

WCF-NetNamedPipe

WCF-NetTcp

WCF-WSHttp

WCF-BasicHttp

WCF-Custom

WCF-CustomIsolated

WCF-NetMsmq

WCF-NetNamedPipe

WCF-NetTcp

WCF-WSHttp

Two-way

WCF-BasicHttp

WCF-Custom

WCF-NetNamedPipe

WCF-NetTcp

WCF-WSHttp

WCF-BasicHttp

WCF-Custom

WCF-CustomIsolated

WCF-NetNamedPipe

WCF-NetTcp

WCF-WSHttp

Note: Adapters built using WCF LOB Adapter SDK are consumed within BizTalk using WCF-Custom BizTalk WCF Adapter. Once the adapter is configured, it shows up in the Binding Type drop-down box and can be selected like any other predefined WCF binding.

The following section shows, at a very high level, how a BizTalk WCF Adapter is used within a typical BizTalk programming lifecycle.

· Design-Time Experience

o Create a Visual Studio BizTalk Project

o Use Consume WCF Service Wizard (Right Click > Add > Add Generated Items > Consume WCF Service) to download metadata from a running service using MEX endpoint or import metadata using WSDL.

§ Following files are generated as an outcome of running this wizard.

Metadata

XML Schema Files

Orchestration

BizTalk Orchestration (.odx) file

Port Binding Information Configuration

{ServiceName}_Custom.BindingInfo.xml – Contains port configuration using WCF Custom Adapter

{ServiceName}.BindingInfo.xml – Contains port configuration using other WCF bindings as obtained from the MEX endpoint

These configuration files can be imported in

§ MEX endpoints only with these transport types are supported

o http, https, net.pipe, net.tcp

o Implies users CANNOT use this wizard to import metadata from MEX enabled services that use a custom transport channel. WCF users can publish and retrieve metadata over a custom binding, which may include transports (and schemes) other than the ones defined above.

§ Port Binding Information Configuration Contains operation to action mapping strings

· <BtsActionMapping> <Operation Name=”Operation1” Action=”Action1”/> </BtsActionMapping>

o Build the BizTalk Project

· Deployment-Time Experience

o Deploy the BizTalk Project

o Import the Port Binding Information XML file to auto-generate the ports in BizTalk Server 2006 Administration Console

§ Right click on Applications within BizTalk Group, select Import > Bindings and then navigate to the Visual Studio BizTalk project folder

§ Select the Port Binding Information XML file

o

Enlist and start the orchestration (and all its dependencies)

· Execution-Time Experience

o Trigger the orchestration depending on your scenario – e.g. dropping a file in the file drop for receive location to pick it up

See the attached document for screen shots of Consume WCF Service Wizard.

BizTalk 2006 R2 - Consume WCF Service.docx

Comments

  • Anonymous
    April 15, 2007
    Hi, I wrote an adpater usign WCF LOB Adapter framework that just send the same message back. I have cofigured to call this adapter from inside biztalk usign custom binding in Biztalk. I have a solicit response port configured to call this Adapter. When I run this code BizTalk calls AsyncOutboundHandler instead of just Outbound handler? I havent implemented AsyncOutboundHandler in my adapter? 1st question is how to implement AsyncOutboundHandler and 2nd why BizTalk is calling AsyncOutboundHandler instead of OutboundHandler as this is a synchnorous call?

  • Anonymous
    April 16, 2007
    The comment has been removed

  • Anonymous
    May 01, 2007
    The Microsoft BizTalk Server 2006 R2 will ship with a BizTalk WCF Adapter. The BizTalk WCF Adapter is

  • Anonymous
    May 08, 2007
    The Microsoft BizTalk Server 2006 R2 will ship with a BizTalk WCF Adapter. The BizTalk WCF Adapter is

  • Anonymous
    May 14, 2008
    How do we import web.config file setting and wse3policycache.config file in Biztalk Server while deployment.

  • Anonymous
    February 02, 2010
    Do you have any thoughts, or links, about what to do when the wcf service you're generating changes? If the url or schemas of the service change, what's the best way to update your project with the new stuff?