Step 9: Test the Solution


In this topic you test the hybrid application by sending a X12 840 sales order message to the HTTP endpoint where the EDI agreement is deployed. The sample sales order message looks like the following:

ISA*00*          *00*          *ZZ*CONTOSO        *ZZ*NORTHWIND      *991221*1226*U*00401*000000025*0*T*:~
N3*Contoso*One Contoso Way~

In this message, the highlighted segment (the line starting with PO1) contains the order quantity. The order quantity in this message is 121. So, if you send this message, it must be inserted into the SalesOrder table. You can update the quantity to less than 100 and resend the message, it must then be sent to the file location you specified in the FILE send port.

To send this message to the EDI agreement, you can use the MessageSender tool shipped with the samples for Windows Azure BizTalk Services. You can download the samples from

To send a message

  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 EDI agreement. This tool accepts command-line parameter in the following format:

    MessageSender.exe <ServiceBusNamespace> <IssuerName> <IssuerKey> <EDI agreement endpoint> <MessageFilepath> <ContentType>


    Parameter name



    The Service Bus namespace


    Issuer Name for the specified namespace


    Issuer Key for the specified namespace

    EDI agreement endpoint

    The endpoint where the EDI agreement is deployed. You can get this endpoint URL from the Receive Settings tab (and within that, the Transport page) of the EDI agreement you deployed in Step 2 (For Azure): Create an EDI Agreement.


    Path to the file that contains the sample request message.


    For this tutorial, set this parameter to text/plain.

    Open a command prompt and navigate to the solution where you built the MessageSender project. Run the following command to send the request message with order quantity more than 100:

    MessageSender.exe <service bus namespace> owner <issuer key> https://<namespace> <path to the sample message> "text/plain"
  3. Open SQL Server Management Studio, connect to the database that contains the SalesOrder table, and verify that a new record is inserted into the table. Notice the value in the Qty column; it must be 121.

  4. Use MessageSender to send another message, but this time set the value of the quantity ordered in the message to 99. You will notice that now, no record is inserted in the SalesOrder table. Instead, the message is copied to the file location you specified for receiving messages with order quantity less than 100. The received message resembles the following:

    <ns1:SalesOrder xmlns:ns0="" xmlns:ns1="http://ECommerceSalesOrder.Inbound">
        <Line2>One Contoso Way</Line2>
      <Comments>Order from Partnerco</Comments>

    Notice the value in the Quantity element. It is 99.

Community Additions