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

  • Client Application

Service Bus Explorer

To test the application using the Service Bus Explorer:

  1. Use the Get-SBClientConfiguration Windows PowerShell cmdlet to retrieve the connection string of your Service Bus namespace.

  2. 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:

    Connect Form

  3. 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:

    Copy Queue Url

  4. 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:

    Send Messages Message Tab

  5. 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:

    Send Messages Sender Tab

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.

Client Application

To test the application using the Client Application:

  1. To send a request message to the StaticSendPortOrchestration, set the Method property to Static.

  2. To send a request message to the DynamicSendPortOrchestration, set the Method property to Dynamic.

  3. To send a request message to BizTalk Server using the requestqueue, click the Queue radio button in the Request Methods group.

  4. To send a request message to BizTalk Server using the requesttopic, click the Topic radio button in the Request Methods group.

  5. To send the response message from BizTalk Server to the responsequeue, click the Queue radio button in the Response Methods group.

  6. 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:

Client Dynamic

When the client sends the request message to the requesttopic, the following occurs:

  1. The BizTalk application reads the request from the ItalyMilan subscription for the requesttopic using the WCF-Custom receive location.

  2. The DynamicSendPortOrchestration sends the response message to the responsetopic.

  3. 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.

Next

Solution Conclusion

See Also

Concepts

Environment Setup
Create the WCF Contracts
Create the Endpoint Behaviors
Install and Configure Components
Create the BizTalk artifacts
Invoke the application
Test the Solution
Solution Conclusion