With Release of BizTalk 2013, a new adapter was available which helps expose BizTalk endpoints as  REST endpoints, This adapter, webhttp adapter has opened up a lot of integration possiblities as many app in todays scenario like to use the REST apis. This article aims to discuss how to configure and expose the BizTalk endpoint as a GET endpoint using BTDF framework. This article assumes that the reader has a basic understanding of BizTalk product and how the development and deployment for BizTalk  application works. This article is can be thought of as part two of BizTalk Server: Creating and Deploying BizTalk HTTP Receive Locations using BTDF framework 

↑Back To Top 

BizTalk Application

The sample BizTalk application accepts the FirstName and LastName as the input in the service url and sends back an appended name. The first name and the last name are provided as parameters in the GET request and the BizTalk orchestration appends the name and returns the response. Following is the BizTalk response xsd.

      <b:imports xmlns:b="">
        <b:namespace prefix="ns0" uri="https://WebHttpLocationBTDFDemo.PropertySchema" location=".\PropertySchema.xsd" />
  <xs:element name="Response">
          <b:property distinguished="true" xpath="/*[local-name()='Response' and namespace- uri()='http://WebHttpLocationBTDFDemo.ServiceTypes']/*[local-name()='FullName' and namespace-uri()='']" />
        <xs:element name="FullName" type="xs:string" />

The orchestration accepts a untyped message (XMLDocument), hence the receive shape in the orchestration requires a filter expression to create subscriptions. Following is the orchestration screenshot.

The first and the last names can be accessed like below.

varFirstName = msgIp(WebHttpLocationBTDFDemo.FirstName);
varLastName = msgIp(WebHttpLocationBTDFDemo.LastName);
varFullName = varFirstName + varLastName;
varXmlDoc = new System.Xml.XmlDocument();
varXmlDoc.LoadXml("<ns0:Response xmlns:ns0='http://WebHttpLocationBTDFDemo.ServiceTypes'><FullName></FullName></ns0:Response>");
msgOp = varXmlDoc;
msgOp.FullName = varFullName;

↑Back To Top

Using BTDF To Create WebHttp GET Endpoint

Introduction To BTDF 

BTDF is an open source deployment framework used for deploying BizTalk applications on local dev boxes as well as different environments. It provides many facilities that can be used to club together the task that require to be performed pre and post deployment of the BizTalk deployment e.g restarting of the concerned Host Instances, IIS reset etc. Another advantage of BTDF is that it is very flexible and can be configured to do a lot of tasks before, during and after the deployment of BizTalk application. All these tasks can be packaged up as a single msi file and can be installed on the target environment. It also provides facility to define the variables related to different environments in a spreadsheet which simplifies the task of manually maintaining the binding files for the BizTalk application for Multiple environment. These are some of the features of BTDF. BTDF has proven to be a very reliable tool for creating build msi for BizTalk. It is a necessary weapon in the arsenal of a professional working on BizTalk platform. 

This article uses the latest version 5.7 that is released. To learn more about the installation of the btdf and step by step guide for configuring the BTDF, refer following link. The link discusses the steps taken for BizTalk 2016 and Visual Studio 2015 , but same can be followed for other versions of BizTalk.

Step by Step Guide For Installation and Configuration of BTDF for BizTalk 2016 and Visual Studio 2015 

Creating Services Project For Deployment

Before the BTDF can be configured to deploy the services, a project which houses the service descriptions and schemas related to the BizTalk web http service, Following is a sample of the services project.

Setting Up Initial Properties

In order to create the IIS application and reset the application pool after the deployment , following properties need to be set under the <PropertyGroup> record in the btdf project file. 


In case if the IISReset is not required, the the <SkipIISReset> property can be set to True 

Including BizTalk Application To Deploy

As the sample project contains only one BizTalk project which has all the artefacts clubbed together, just one item group is sufficient for the BTDF to deploy the assembly to BizTalk group.

  <Schemas Include="WebHttpLocationBTDFDemo.dll">

Creating Application Pool

In order to create the application pool to process the request received at IIS, an <ItemGroup> has to be added to the  btdf project file. BTDF gives the flexibility to the developers to deploy their application from Visual Studio also and by creating a build server msi. So two different setting need to be made based upon the method of deployment. The main difference between the two settings is the way they read the user ID and password for the identity to be set up for the application pool. In case of the Visual studio deployment the user Id and password can be configured in the item group itself while in case of server deploy using msi it can be asked from the administrator installing the msi

Deploying From Visual Studio

Following are the properties that need to be set up for the BTDF to be able to create the Application pool in IIS when the developer does a deployment from Visual Studio using BTDF .

  <IISAppPool Include="webHTTPAdapterDemoAppPool" Condition="'$(Configuration)' != 'Server'">

Deploying Using MSI

Following are the properties that need to be set up so that when the deployment is being done on a server instead of a dev box, the BTDF is able to create the Application pool in IIS.

  <IISAppPool Include="webHTTPAdapterDemoAppPool" Condition="'$(Configuration)' == 'Server'">

The variable $(IsolatedHostUserName) and $(IsolatedHostUserPassword) are to be set up in the InstallWizard.xml file ( gets generated while creating a BTDF project).

A sample InstallWizard.xml file is shown below.

<?xml version="1.0" encoding="utf-8" ?>
    Deployment Framework for BizTalk
    Copyright (C) 2008-14 Thomas F. Abraham, 2004-08 Scott Colestock
<!-- Each SetEnvUIConfigItem element defines a single page in the wizard that appears during a server deployment. -->
<!-- The EnvironmentVarName element specifies the name of an environment variable that will contain the value of the -->
<!-- user's selection. Each environment variable automatically becomes an MSBuild property that you may reference in -->
<!-- your .btdfproj file. -->
    <PromptText>Select the XML file that contains configuration information specific to this environment:</PromptText>
    <PromptText>Enter the domain qualified username for the IIS app pool</PromptText>
    <PromptText>Enter the Password for the Username entered in previous step</PromptText>
      <PromptText>Is this the LAST server in the BizTalk Group you are deploying to?If so, BizTalk assemblies will be deployed to the BizTalk Management Database.</PromptText>
      <Caption>This is the LAST server in the BizTalk Group</Caption>

Creating an IIS Application

In order to create an IIS application after the deployment, following setting needs to be added to the BTDF project. ( Here the service details that were captured earlier from the IIS , copied to the WebHttpLocationBTDFDemo.Services project will be used). 

  <IISApp Include="WebHttpLocationDemo">
    <SiteName>Default Web Site</SiteName>

The exclusion tells the BTDF to ignore the files that it should not deploy under the IIS Application.

Configuring The Receive Location in Port Bindings Master 

A typical entry for the recive location exposed a GET REST endpoint will look like following.

    <ReceivePort Name="WcfReceivePort_WebHttpLocationDemo/Service1" IsTwoWay="true" BindingOption="1" AnalyticsEnabled="false">
      <Description xsi:nil="true" />
        <ReceiveLocation Name="WcfService_WebHttpLocationDemo/Service1">
          <Description xsi:nil="true" />
          <PublicAddress />
          <ReceiveLocationTransportType Name="WCF-WebHttp" Capabilities="387" ConfigurationClsid="e5b2de81-de67-4559-869b-20925949a1e0" />
          <ReceiveLocationTransportTypeData><CustomProps><DisableLocationOnFailure vt="11">0</DisableLocationOnFailure><HttpMethodAndUrl vt="8">&lt;BtsHttpUrlMapping&gt;
&lt;Operation Name="AppendName" Method="GET" Url="/AppendName?FirstName={FirstName}&amp;amp;LastName={LastName}" /&gt;
&lt;/BtsHttpUrlMapping&gt;</HttpMethodAndUrl><MaxReceivedMessageSize vt="3">65536</MaxReceivedMessageSize><VariablePropertyMapping vt="8">&lt;BtsVariablePropertyMapping xmlns:xsi="" xmlns:xsd=""&gt;
  &lt;Variable Name="FIRSTNAME" PropertyName="FirstName" PropertyNamespace="https://WebHttpLocationBTDFDemo.PropertySchema" /&gt;
  &lt;Variable Name="LASTNAME" PropertyName="LastName" PropertyNamespace="https://WebHttpLocationBTDFDemo.PropertySchema" /&gt;
&lt;/BtsVariablePropertyMapping&gt;</VariablePropertyMapping><SecurityMode vt="8">None</SecurityMode><IncludeExceptionDetailInFaults vt="11">0</IncludeExceptionDetailInFaults><TransportClientCredentialType vt="8">None</TransportClientCredentialType><OpenTimeout vt="8">00:01:00</OpenTimeout><UseSSO vt="11">0</UseSSO><SuspendMessageOnFailure vt="11">0</SuspendMessageOnFailure><CloseTimeout vt="8">00:01:00</CloseTimeout><SendTimeout vt="8">00:01:00</SendTimeout><MaxConcurrentCalls vt="3">200</MaxConcurrentCalls></CustomProps></ReceiveLocationTransportTypeData>
          <ReceivePipeline Name="Microsoft.BizTalk.DefaultPipelines.XMLReceive" FullyQualifiedName="Microsoft.BizTalk.DefaultPipelines.XMLReceive, Microsoft.BizTalk.DefaultPipelines, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Type="1" TrackingOption="None" Description="" />
          <ReceivePipelineData><Root xmlns:xsd="" xmlns:xsi=""><Stages><Stage CategoryId="9d0e4105-4cce-4536-83fa-4a5040674ad6"><Components><Component Name="Microsoft.BizTalk.Component.XmlDasmComp"><Properties><AllowUnrecognizedMessage vt="11">-1</AllowUnrecognizedMessage></Properties></Component></Components></Stage><Stage CategoryId="9d0e410e-4cce-4536-83fa-4a5040674ad6"><Components><Component Name="Microsoft.BizTalk.Component.PartyRes"><Properties /></Component></Components></Stage></Stages></Root></ReceivePipelineData>
          <SendPipeline Name="Microsoft.BizTalk.DefaultPipelines.PassThruTransmit" FullyQualifiedName="Microsoft.BizTalk.DefaultPipelines.PassThruTransmit, Microsoft.BizTalk.DefaultPipelines, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Type="2" TrackingOption="None" Description="" />
          <SendPipelineData xsi:nil="true" />
          <ReceiveHandler Name="BizTalkServerIsolatedHost" HostTrusted="false">
            <TransportType Name="WCF-WebHttp" Capabilities="387" ConfigurationClsid="e5b2de81-de67-4559-869b-20925949a1e0" />
      <SendPipelineData xsi:nil="true" />
      <Transforms />
      <OutboundTransforms />

This completes the setup of BTDF for the deployment. 

↑Back To Top 

Verifying Deployment

When Deployed using BTDF project configured above, following artifacts were created.

Application Pool


IIS Application

BizTalk Receive Location

The HTTP Method and URL mapping for the GET operation is as follows.

<Operation Name="AppendName" Method="GET" Url="/AppendName?FirstName={FirstName}&LastName={LastName}" />

The {FirstName} and {LastName} are mapped using the promoted properties as below.


↑Back To Top 


A Get can be done simply using any browser available. Following are some of the samples that were tested against the BizTalk Application deployed earlier.


↑Back To Top 


As observed from the test results, it can be concluded that it is very easy to set up the BizTalk web HTTP receive locations using BTDF. 

↑Back To Top 

See Also

An important place to find a huge amount of BizTalk related articles is the TechNet Wiki itself. The best entry point is BizTalk Server Resources on Technet Wiki 

↑Back To Top 


Following articles were referred while writing this article
↑Back To Top