SALES: 1-800-867-1380

Step 7: Test the Solution

Updated: November 21, 2013

This topic in the tutorial provides instructions on how to test the solution by sending messages with different quote amounts to the endpoint where the XML Request-Reply Bridge is deployed. The tutorial uses a tool, MessageSender, to send messages to the endpoint. The tool is available with the sample package and can be downloaded from the MSDN Code Gallery.

The solution must be tested by sending messages with different schemas and messages that have quote amount less than or greater than $10000. So, the SampleData folder within the package includes the following sample request messages that you can use to test the solution.

 

ACORD1_RequestMesssage_SmallAmount.xml

Compliant with ACORDRq1.xsd

QuoteAmount = $1000

ACORD1_RequestMessage_LargeAmount.xml

Compliant with ACORDRq1.xsd

QuoteAmount = $15000

ACORD2_RequestMessage_SmallAmount.xml

Compliant with ACORDRq2.xsd

QuoteAmount = $1000

ACORD2_RequestMessage_LargeAmount.xml

Compliant with ACORDRq2.xsd

QuoteAmount = $15000

To send a message to the bridge

  1. Locate the MessageSender project in the sample package and build it.

  2. Use the resulting MessageSender command-line executable (under \bin\Debug folder within the project) to send messages to the deployed bridge endpoint. This tool accepts command-line parameter in the following format:

    MessageSender.exe <ACSNamespace> <IssuerName> <IssuerKey> <RuntimeAddress> <MessageFilepath> <ContentType>
    

    Where,

     

    Parameter name Description

    ACS Namespace

    The ACS namespace for the BizTalk Services deployment.

    IssuerName

    Issuer Name for the specified namespace

    IssuerKey

    Issuer Key for the specified namespace

    RuntimeAddress

    Runtime address or the endpoint URL where the bridge is deployed.

    MessageFilePath

    Path to the file that contains the sample request message.

    ContentType

    For this tutorial, set this parameter to application/soap+xml.

    Open a command prompt and navigate to the solution where you built the MessageSender project. Run the following command to send the request message that has quote amount less than $10000:

    MessageSender.exe <ACSNamespace> owner <issuer key>https://<biztalk_deployment_url>.biztalk.windows.net/default/ServiceBridge<path to the samples>\Bridges_RelayServices\SampleData\ACORDR1_RequestMessage_SmallAmount.xml "application/soap+xml"
    
  3. Because RelayReceiverServiceA processes messages with quote amounts less than $10000, go to the command prompt for the service. If the service receives the message successfully, you must see the following message displayed on the console:

    *************************************************************************
    Message processed successfully. Request message saved at : 
    C:\Tutorial\Lessons\Bridges_RelayServices\RelayReceiverServiceA\bin\Debug\Received_Message<unique_number>.xml
    *************************************************************************
    

    The text indicates that the service received the message from the bridge and that the message is saved at the given location. Go to the location where the message is saved and open the message XML file. Notice that the message includes the following header:

    <QuoteType xmlns="http://Northwind.com/insurance/ACORD1/xml/">SmallAmounts</QuoteType>
    

    You had configured the bridge to add the QuoteType custom header in the section Include Custom Headers in the Message.

  4. Now, send the request message where quote amount is greater than $10000. Type the following on the MessageSender command prompt:

    MessageSender.exe <ServiceBusNamespace> owner <issuer key>https://<ServiceBusNamespace>.servicebus.windows.net/ServiceBridge<path to the samples>\Bridges_RelayServices\SampleData\ACORDR1_RequestMessage_LargeAmount.xml "application/soap+xml"
    

    Because RelayReceiverServiceB processes messages with quote amounts less than $10000, go to the command prompt for the service. If the service receives the message successfully, you must see the following message displayed on the console:

    *************************************************************************
    Message processed successfully. Request message saved at :
    C:\Tutorial\Lessons\Bridges_RelayServices\RelayReceiverServiceB\bin\Debug\Received_Message<unique_number>.xml
    *************************************************************************
    

    Once again, go to the location where the request message is saved. This time, notice that the value of the QuoteType header is set to LargeAmounts.

    <QuoteType xmlns="http://Northwind.com/insurance/ACORD1/xml/">LargeAmounts</QuoteType>
    
  5. In both the cases, whether you send a request message with a smaller quote amount or a larger quote amount, a message is displayed on the MessageSender console as well:

    Sending data to end point: https://<biztalk_deployment_url>.biztalk.windows.net/default/ServiceBridge
    Tracking ID for the message sent is <tracking ID>
    Message sent successfully
    Received response
    ********************************************************************************
    Received a response message from the bridge. The message is saved at : 
    C:\Tutorial\Lessons\Bridges_RelayServices\MessageSender\MessageSender\bin\Debug\Response_Message<unique_number>.xml
    ********************************************************************************
    

    Go to the location where the response messages are saved and open the two messages. Notice the following in the two messages:

    • Both the response messages have the MsgStatusCd element in the message body and its value is set to Success.

      <ns1:MsgStatusCd>Success</ns1:MsgStatusCd>
      
      You had extracted this value from the response message header and passed it on to the response message body as part of the procedure To extract and promote properties in the pre-transform Enrich stage.

    • Both the response messages have the following header included:

      <ProcessingStatus xmlns="http://Northwind.com/insurance/ACORD1/xml/">Complete</ProcessingStatus>
      
      You had configured the bridge to add this custom header in the section To configure the reply action.

    • Finally, both the response messages have two other custom headers as well, MsgStatus and Eligibility. The relay service adds these headers as part of the response message. While the value of MsgStatus is set to Success in responses from both the services, the value of Eligibility varies depending on which service sent the response:

       

      Response from RelayReceiverServiceA

      Includes the header with value set to ApprovedForSmallAmounts:

      <Eligibility xmlns="http://Northwind.com/insurance/ACORD1/xml/">ApprovedForSmallAmounts</Eligibility>
      

      Response from RelayReceiverServiceB

      Includes the header with value set to ApprovedForLargeAmounts:

      <Eligibility xmlns="http://Northwind.com/insurance/ACORD1/xml/">ApprovedForLargeAmounts</Eligibility>
      
      Because both the responses are sent back the same message sender client, you can use the Eligibility header to determine whether the response came from RelayReceiverServiceA or RelayReceiverServiceB.

  6. Repeat steps 2 and 3 by sending messages that are compliant with ACORDRq2.xsd. In the response messages that the client receives, notice that an additional node (Comments) is included. You configured the bridge to extract this element from the request message in the procedure To extract and promote properties in the pre-transform Enrich stage and then configured the Transform to pass the extracted value to the response message in the procedure To map NorthwindSchema.xsd to ACORDRs2.xsd.

See Also

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft