Step 4: Configure the Send Ports
The next step is to create the send ports used in the BizTalk application. This topic lists the steps to create the WCF-Custom send ports used by the StaticSendPortOrchestration and DynamicSendPortOrchestration orchestrations to send response messages to the requestqueue and requesttopic. Specifically, the StaticSendPortOrchestration uses two static one-way send ports, one for each messaging entity. The DynamicSendPortOrchestration uses a dynamic send port that decides at runtime where to send the response message. The end location is based on the address specified by the client application and contained in the ReplyTo context property.
StaticSendPortOrchestration Send Port
To create the WCF send port used by the StaticSendPortOrchestration to send response messages to the responsequeue:
Open the BizTalk Server Administration Console and expand Send Ports under the ServiceBusForWindowsServer application.
Create a new Static One-way Send Port. Configure the send port:
Enter a name for the send port and select a pipeline based on your requirements. This sample uses the PassThruTransmit pipeline.
Select the WCF-Custom adapter and click the Configure button:
In the General tab, enter the URL of the responsequeue in the Address (URI) field. Confirm the correct value is entered in the Action field. The Action value is equal to the Action of the method exposed by the WCF service used by the client to receive the response:
Click the Binding tab and select NetMessagingBinding from the Binding Type drop-down list. Set the binding properties in the Configuration properties:
Click the Behavior tab, right-click the EndpointBehavior node and click bizTalkSecurity. Click the corresponding node, click the token provider and enter a domain, user name, and password. For security reasons, it’s not recommended to use the same account as the host instance.
Enter the stsEndpoint URL used by the Service Bus namespace:
Right-click the EndpointBehavior node and click bizTalkMessageInspector. Click the PropertiesToSend node and enter the name and namespace lists of the user-defined properties to include in the outgoing message.
In this sample, the send port adds the Application, Country, and City properties to the response BrokeredMessage. The Application context property demonstrates how a BizTalk application can send context information out-of-band to another application using a Service Bus message. The Application property is added to the response BizTalk message by the orchestration.
The bizTalkMessageInspector endpoint behavior is required for routing purposes. The client uses the ItalyMilan subscription to receive response messages written to the responsetopic. The subscription uses the following filter expression:
Country='Italy' and City='Milan'
As a result, bizTalkMessageInspector is required to transform the Country and City context properties of the BizTalk message into user-defined properties of the outgoing BrokeredMessage:
Click the Messages tab and clear Use Transaction:
Click OK to close the WCF-Custom adapter configuration dialog.
Click OK to complete the creation of the WCF-Custom send port.
StaticSendPortOrchestration Send Port
To create the WCF send port used by the StaticSendPortOrchestration to send response messages to the responsetopic:
Open the BizTalk Server Administration Console and expand Send Ports under the ServiceBusForWindowsServer application.
Create a new static one-way send port. Configure the send port:
Enter a send port name and select a pipeline based on your requirements. This sample uses the PassThruTransmit pipeline. Select the WCF-Custom adapter and click the Configure button:
In the General tab, enter the URL of the responsetopic in the Address (URI) field. Confirm the correct value is entered in the Action field. The Action value is equal to the Action of the method exposed by the WCF service used by the client to receive the response:
Click the Behavior tab, right-click the EndpointBehavior node and click bizTalkSecurity. Click the corresponding node, click the token provider, and enter a domain, user name, and password. For security reasons, it’s not recommended to use the same account as the host instance.
Enter the stsEndpoint URL used by the Service Bus namespace:
Right-click the EndpointBehavior node and click bizTalkMessageInspector. Click the PropertiesToSend node and enter the name and namespace lists of the user-defined properties to include in the outgoing message.
In this sample, the send port adds the Application, Country, and City properties to the response BrokeredMessage. The Application context property demonstrates how a BizTalk application can send context information out-of-band to another application using a Service Bus message.
In this scenario, using serviceBusMessageInspector is not strictly required for routing purposes. The client can retrieve the message from the responsequeue, even if the message does not contain the Application, Country, and City properties:
Click the Messages tab and clear Use Transaction:
Click OK to close the WCF-Custom adapter configuration dialog.
Click OK to complete the creation of the WCF-Custom send port.
DynamicSendPortOrchestration Send Port
Create the dynamic send port used by the DynamicSendPortOrchestration to send messages to the responsequeue or responsetopic, based on the URL specified by the client application in the ReplyTo property of the Service Bus message.
Open the BizTalk Server Administration Console and expand Send Ports under the ServiceBusForWindowsServer application.
Create a new dynamic one-way send port. Configure the send port:
Enter a send port name and select a pipeline based on your requirements. This sample uses the PassThruTransmit pipeline:
In BizTalk Server 2013, select a Send Handler by clicking the Configure button:
Click OK to close the Send Handler configuration dialog.
Click OK to finish creating the WCF-Custom send port.
When complete, the following send ports are created:
Next Step
Step 5: Create the Orchestrations
See Also
Concepts
Step 1: Create the Property Schemas
Step 2: Create the Request and Response Schemas
Step 3: Configure the Receive Locations
Step 4: Configure the Send Ports
Step 5: Create the Orchestrations
Create the BizTalk artifacts