Logo
programming4us
programming4us
programming4us
programming4us
Home
programming4us
XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
Windows Server

WCF and BizTalk 2009 (part 2) - Publishing Your WCF Service from the Command Line & Consuming WCF Services

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
6/30/2011 3:28:02 PM

12.1.3. Publishing Your WCF Service from the Command Line

The BizTalk WCF Service Publishing Wizard is convenient to use when deploying an endpoint within your development environment. For more advanced users or when automating your deployment, there is an additional downloadable command-line tool from Microsoft called the BtsWcfServicePublishing[] tool.

[] Download the BTSWCFServicePublishing tool from http://go.microsoft.com/fwlink/?LinkId=92955.

The tool has the following syntax:

BtsWcfServicePublishing PathName [-AdapterName:value] [-EnableMetadata]
[-ReceiveLocation] [-ApplicationName:value] [-MetadataOnly]
[-MetadataReceiveLocationName:value] [-MergePorts]
[-TargetNamespace:value]
[-Location:value] [-Overwrite] [-Anonymous]

This is a basic sample invocation of this tool:

BtsWcfServicePublishing.exe "MyAssembly.dll" 

-Location:http://localhost/MyVdir -Overwrite

This sample publishes the orchestration in MyAssembly.dll to http://localhost/MyVdir with the default values and overwrites any existing service at this location.

Of course, the default values are not very friendly; therefore, the tool supports many parameters to customize the output. Table 3 lists these parameters.

Table 3. Command-Line Parameters for the BtsWcfServicePublishing Tool
ParameterRequiredDescription
PathNameYesPath and file name of BizTalk assembly (*.dll) or WCF service description (*.xml) file.
-AdapterNameNoPublishes a service endpoint. Specify which adapter will be used: WCF-BasicHttp, WCF-WSHttp, or WCF-CustomIsolated. This field is valid when publishing a service endpoint. The default is WCF-WSHttp.
-EnableMetadataNoEnables metadata endpoint in addition to service endpoint. This field is valid when publishing a service endpoint. The default is False.
-ReceiveLocationNoCreates receive locations in the specified BizTalk application. This field is valid when publishing a service endpoint with the BizTalk application name specified. The default is False.
-ApplicationNameNoName of the BizTalk application in which to create receive locations. This field is valid when publishing a service endpoint with the receive location specified. The default is BizTalk Application 1.
-MetadataOnlyNoPublishes a metadata-only endpoint. This field is valid when publishing a service endpoint. The default is False.
-MetadataReceiveLocationNameNoName of WCF-adapter receive location to expose at metadata-only endpoint. You can further edit it in Web.config after publishing. This field is valid when publishing a metadata endpoint. The default is Null.
-MergePortsNoMerges all ports into a single WCF service if possible. The default is False.
-TargetNamespaceNoTarget namespace of WCF service. The default is http://tempuri.org.
-LocationNoLocation in which to publish. For example, http://host[:port]/path. This is automatically generated based on the project name.
-OverwriteNoOverwrites (deletes contents of) specified location. The default is False.
-AnonymousNoAllows anonymous access to WCF service. The default is False.

4. Consuming WCF Services

Just as there is a wizard to help you publish a WCF service, there is also a BizTalk WCF Service Consuming Wizard. You can launch this wizard from within the orchestration designer; it creates port types and message types necessary for consuming WCF services. The wizard also creates two binding files that can be imported by the development command-line tool or wizard to configure the send ports with the system-provided binding WCF adapters and the WCF-Custom adapter.

To add schemas and types for WCF services to your orchestration, follow the steps described in the following subsections.

4.1. Step 1: Start the Biztalk WCF Consuming Wizard

In the Solution Explorer, right-click your project, click Add, and select Add Generated Items. In the Add Generated Items dialog box, select Consume WCF Service, and click Add to launch the wizard.

4.2. Step 2: Import Metadata

Click Next on the welcome screen to display the Metadata Source screen, as shown in Figure 5.

Figure 5. Selecting a metadata source

The easier option is to use a MEX endpoint, which will dynamically download the WSDL and supporting XSDs. If you have previously downloaded or been provided with these files, then choose the Metadata Files option. Leave the default option, and click Next.

4.3. Step 3: Supply a Metadata URL

On the Metadata Endpoint screen, enter the URI to the metadata endpoint you want to include, and click Next.

The metadata endpoint doesn't have to be over HTTP or HTTPS. The wizard also supports net.tcp and net.pipe URIs.


4.4. Step 4: Complete the Wizard

After the WSDL has been downloaded, click Next to complete the wizard. The necessary port types and message types will be created and ready to use within your orchestration. Simply bind your message types to an orchestration port and connect to shapes.

5. Specifying Dynamic Port Properties

As with other adapters, the WCF adapters support dynamic send ports. These are useful for customizing parameters of WCF calls with runtime values that may be passed with incoming messages or as a result of a business rule.

The following code demonstrates how to modify the transport security option of a WCF-NetTcp adapter:

MessageOut=MessageIn;
MessageOut(WCF.Action)="http://tempuri.org/IReceiveMessage/ReceiveMessage";
MessageOut(WCF.SecurityMode)="Transport";
MessageOut(WCF.TransportClientCredentialType)="Windows";
DynamicSendPort(Microsoft.XLANGs.BaseTypes.Address)=

"net.tcp://localhost:8001/netTcp";
DynamicSendPort(Microsoft.XLANGs.BaseTypes.TransportType)="WCF-NetTcp";

Using the WCF context object, all properties of the WCF adapter can be dynamically changed if necessary to meet your requirements. The previous example tells the adapter to implement transport-level security leveraging the Windows identity as its credential token. The code also overrides the WCF endpoint address and sets the transport type to the WCFNetTcp adapter.

Other -----------------
- WCF and BizTalk 2009 (part 1) - Exploring the Built-in WCF Adapter Transport Support & Using the WCF Service Publishing Wizard
- SQL Server 2008 : Working with Synonyms
- SQL Server 2008 : Working with Views -Partitioned Views, Updateable Views & Indexed Views
- SQL Server 2008 : Post-Installation - Preproduction Tasks
- Microsoft PowerPoint 2010 : Expanding PowerPoint Functionality - Simplifying Tasks with Macros
- Microsoft PowerPoint 2010 : Enhancing a Presentation with VBA & Setting Developer Options
- Windows Server 2008 R2 : Manage Disk Storage - Manage Disk Storage Quotas
- Windows Server 2008 R2 : Work with RAID Volumes - Understand RAID Levels & Implement RAID
- Exchange Server 2010 : Perform Essential Public Folder Management (part 3) - Configure Client Connectivity
- Exchange Server 2010 : Perform Essential Public Folder Management (part 2) - Define Public Folder Permissions
 
 
Top 10
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
 
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server