BizTalk Logical Ports & Port Bindings

This blog is to explain various ports and port Bindings in Orchestration.

There are two types of ports in BizTalk.

  • Logical Ports: Ports which are used in Orchestration
  • Physical Ports: Ports which are used in BizTalk admin console

Each logical port (Except Direct Binding) should have binding with a physical port in BizTalk admin console

Since this blog is related to orchestration stuff, let’s talk about logical ports.

There are two types of logical ports

Inbound Logical Ports:

These ports are used to receive the messages from message box to Orchestration. These are also called as Subscribers (Subscribing messages from Message box DB)

Outbound Logical Ports:

These ports are used to send the message from Orchestration to message box. These are also called as Publishers (Publishing messages to Message box DB)

How to Create Logical Ports:

  1. When you open the orchestration, you would see below screen


2. Right click on Port Surface–>Select “New Configured Port”



3. Port Configuration Wizard appears and then click on “Next”–>Provide the name of the Port (Port_AppraisalInput)–>Click Next–>Provide PortType Name as “PortType_AppraisalInput”–>Click Next

Communication Pattern:

  • One-Way—Select this option if you want to create oneway port
  • Request-Response – Select this option if you want to create two-way port.

Access Restrictions:

Choose appropriate option based on your requirement



4. Port Direction for Inbound:

For Inbound logical port, select “I’ll always be receiving messages on this port” option.

For Outbound logical port, select “I’ll always be sending messages on tis port” option.


Port Bindings are three types.

  • Specify now
  • Specify Later
  • Direct

Specify now: you need to provide URL, Adapter and Pipeline details in design time itself.


Specify Later: If you select this option, you need to provide the URI, Transport and Pipeline details in BizTalk Admin console.


Direct Binding: This is loosely coupled Binding type. There are three options in Direct Binding and by default first option is selected in the screen. If we use this option, messages are subscribed from message box using filter condition in Receive shape properties.



Self-correlating direct bound ports are self-referential. This means that a self-correlating direct bound port supplies the information that an orchestration can use to send messages back to its enclosing orchestration. Please go through the link below for more details.

Partner Orchestration:

Partner orchestration direct bound ports provide the capability of having inter-orchestration communication through ports. Please go through the link below for more details.

Port Direction for Outbound: For outbound port bindings, you can see additional option as “Dynamic”.

Please see the Dynamic send port details in the below link.





BizTalk Dynamic Send Ports For Rest Services

Dynamic send ports are used to send the BizTalk messages dynamically from orchestration to destination systems based on some conditions.

There are two types of dynamic send ports.

  • One-way dynamic Send Port:

Using one-way dynamic send port, we just send the messages to destination systems, but don’t expect the response back.

We need to create a logical send port in orchestration with port direction as Dynamic.


In the expression shape, we need to specify the destination location and Transport Type properties.



In Expression_1, you need to write below code



//Port-Dynamic is the Dynamic send port name.

//In Expression_2, you need to write below code



  • Two Way Dynamic Send Port

Two-way dynamic sendports are used for request and response messages.

We need to create logical dynamic sendport with port direction as dynamic.


We need to construct the message with all request and response message properties of Rest endpoint as below

In the message assignment shape we need to construct the message with below properties.

RequestForRouting = Request;

//Request is the input message type of your orchestration receive shape. RequestForRouting is the message which we construct in this message assignment shape.


headerhttp = Request(WCF.InboundHttpHeaders);//If you have any http headers

RequestForRouting(FILE.ReceivedFileName) = headerhttp;

RequestForRouting(WCF.HttpMethodAndUrl) = “POST” //For POST Operation

RequestForRouting(WCF.HttpMethodAndUrl)=”<BtsHttpUrlMapping><Operation Name=” Method=’GET’ Url=’/RestServiceURL’ /></BtsHttpUrlMapping>”; // For Get Operation

RequestForRouting(BTS.SendPipelineConfig)=”<Root xmlns:xsd=’; xmlns:xsi=’’><Stages><Stage CategoryId=’9d0e4108-4cce-4536-83fa-4a5040674ad6′><Components><Component Name=’Microsoft.BizTalk.Component.JsonEncoder’><Properties><RemoveOuterEnvelope vt=’11’>-1</RemoveOuterEnvelope></Properties></Component></Components></Stage></Stages></Root>”;

RequestForRouting(BTS.SendPipelineResponseConfig) = “<Root xmlns:xsd=’; xmlns:xsi=’’><Stages><Stage CategoryId=’9d0e4103-4cce-4536-83fa-4a5040674ad6′><Components><Component Name=’Microsoft.BizTalk.Component.JsonDecoder’><Properties><RootNode vt=’8′>” + RootNodeName + “</RootNode><RootNodeNamespace vt=’8′>” + Namespace + “</RootNodeNamespace></Properties></Component><Component Name=’Microsoft.BizTalk.Component.XmlDasmComp’><Properties><AllowUnrecognizedMessage vt=’11’>-1</AllowUnrecognizedMessage></Properties></Component></Components></Stage></Stages></Root>”; 


//For POST Operation


“<BtsVariablePropertyMapping xmlns:xsi=’; xmlns:xsd=’’><Variable Name=NameoftheVariable PropertyName=’NameOftheProperty‘ PropertyNamespace=’NameSpace‘/></BtsVariablePropertyMapping>”;

//For Get Operation


//For POST Operation


//For Get Operation

RequestForRouting(BTS.RetryCount) = 0;




RequestForRouting(WCF.SendTimeout)= “00:01:00”;

RequestForRouting(WCF.EndpointBehaviorConfiguration)=”<behavior name=’EndpointBehavior’><AddHttpHeader HeaderFields=’Field1,Field2,Content-Type: application/json’/></behavior>”;

// If you have http headers

In the expression shape, we need to specify Address and TransportType.


DynamicCommonSendPort(Microsoft.XLANGs.BaseTypes.Address)=”Rest Endpoint URL Name”;


Good Luck…