Test the Solution
Once the solution is configured and deployed, you can submit messages using Service Bus Explorer or the Client Application included in this solution. This topic lists the steps for both:
Service Bus Explorer
Service Bus Explorer
To test the application using the Service Bus Explorer:
Use the Get-SBClientConfiguration Windows PowerShell cmdlet to retrieve the connection string of your Service Bus namespace.
Start Service Bus Explorer and open the Connect Form. Select Enter connection string from the Service Bus Namespaces drop-down list, paste the connection string in the Connection String textbox, and click OK:
To receive the response messages from the requestqueue, right-click the corresponding node, and click Copy Queue Url, as shown in the following image. Follow the same steps for the requesttopic to receive response messages using its ItalyMilan subscription:
Right-click requestqueue or requesttopic and select Send Messages. Click the Message tab, click the open button, and select the CalculatorRequest XML document from the Setup folder. Define the following user-defined properties:
Country = Italy
City = Milan
Method = Static to send the message to the StaticSendPortOrchestration
Method = Dynamic to send the message to the DynamicSendPortOrchestration
The dialog window is similar to the following:
Click the Sender tab and select the ReplyTo field. Paste the URL of the responsequeue or responsetopic from the clipboard. Specify the number of messages to send in the Message Count field. Be sure to select WCF from the Body Type drop-down list and click the Start button to send the messages to the requestqueue or requesttopic:
DebugView can be used to see the path produced by the BizTalk components. To verify that the application successfully processed the request and sent a response to the responsequeue or the responsetopicItalyMilan subscription, right-click the corresponding node and select Receive All Messages.
To test the application using the Client Application:
To send a request message to the StaticSendPortOrchestration, set the Method property to Static.
To send a request message to the DynamicSendPortOrchestration, set the Method property to Dynamic.
To send a request message to BizTalk Server using the requestqueue, click the Queue radio button in the Request Methods group.
To send a request message to BizTalk Server using the requesttopic, click the Topic radio button in the Request Methods group.
To send the response message from BizTalk Server to the responsequeue, click the Queue radio button in the Response Methods group.
To send the response message from BizTalk Server to the responsetopic, click the Topic radio button in the Response Methods group.
The following image shows the most interesting combination:
When the client sends the request message to the requesttopic, the following occurs:
The BizTalk application reads the request from the ItalyMilan subscription for the requesttopic using the WCF-Custom receive location.
The DynamicSendPortOrchestration sends the response message to the responsetopic.
The Client Application receives the response message through the ItalyMilan subscription defined on the responsetopic.
Looking at the Client Application log, note the following:
The request message is sent to the requesttopic.
The response message is received from the responsetopic.
The CorrelationId of the response message is equal to the MessageId of the request message.
The message inspector translates the Label property of the request message into the Label context property in the WCF receive location. Then, the orchestration copies the Label context property from the request message to the response message. Finally, the WCF send port copies the value of the Label context property to the Label property of the Service Bus message. The Country and City user-defined properties follow the same data flow.
The orchestration adds the Application context property to the response message. The WCF send port translates this Application property into a user-defined property of the Service Bus message.
The rule action adds the Area property as defined on the ItalyMilan subscription.