Step 4(a): Configure the Request Bridge

 

Important

Microsoft Azure BizTalk Services (MABS) is being retired, and replaced with Azure Logic Apps. If you currently use MABS, then Move from BizTalk Services to Logic Appsprovides some guidance on moving your integration solutions to Logic Apps.

If you're brand new to Logic Apps, then we suggest getting started here:

As part of the request bridge of the XML Request-Reply Bridge, the tutorial demonstrates how to perform the following tasks:

  • Specify the request and response schemas – In this stage, enter the following:

    • Request schemas that govern the request messages that the bridge can process.

    • Response schemas that govern the structure of the response message that the bridge sends back to the client.

  • Configure the pre-Transform Enrich stage – In this stage, define the properties that must be extracted and promoted within the request message. These properties are used within the bridge or within the solution for processing the message, routing it to the destination services, and so on.

  • Configure the Transform stage – In this stage, include the Transforms you defined in the previous steps to Transform the ACORD-compliant request messages to messages in a schema compliant with Northwind’s requirements.

Enter Request and Response Message Schemas

This section provides instructions on how to add a bridge to the BizTalk Service project. The section also describes how to configure the Validate stage to ensure that the bridge processes only those messages that conform to the ACORD request and response schemas.

To add request and response schemas to a bridge configuration

  1. In the Bridges_Services project, double-click the .bcs file to open the itinerary designer.

  2. Right-click anywhere on the itinerary designer and select Properties and then for the BizTalk Service URL property, enter your BizTalk Services URL.

  3. From the Toolbox, drag-and-drop the XML Request-Reply Bridge component to the itinerary designer. As a result a .BridgeConfig file is added to the solution.

  4. Right-click the XML Request-Reply Bridge, select Properties, set the bridge entity name to XMLBridge and the relative address of the bridge to ServiceBridge. As a result, the complete endpoint URL where the bridge is deployed is shown in the Runtime Address property.

  5. Double-click the XML Request-Reply Bridge component to open the Bridge Configuration design surface. You can now enter the type of request and response messages that the bridge can process. To enter the message type, on the XML Request-Reply Bridge design surface, within the Message Types box, select the add icon [ Add icon ] to open the Message Type Picker dialog box.

  6. The Message Type Picker dialog box lists five schemas – two ACORD request schemas (ACORDRq1.xsd and ACORDRq2.xsd), two ACORD response schemas (ACORDRs1.xsd and ACORDRs2.xsd), and one schema that is in the Northwind’s proprietary format (NorthwindSchema.xsd). From the Available message types box, select the ACORDRq1.xsd schema for the request message and select the RIGHT ARROW icon [ Arrow Icon ] to add the schema to the Request Message Type section. Similarly, select the ACORDRs1.xsd schema for the response message and select the RIGHT ARROW icon [ Arrow Icon ] to add the schema to the Response Message Type section. Select OK.

    Repeat this step to add the remaining request (ACORDRq2.xsd) and response (ACORDRs2.xsd) schema and then select OK again. Make sure that you do not select NorthwindSchema.xsd for the request or response schemas.

    Tip

    By default the Message Type Picker dialog box does not display the schema file names; it only displays the root node for each schema. In such a case, identifying the right schema can be difficult. So, to make sure that you select the right schema, move the mouse cursor over the schema to see a tooltip box. That box displays the schema file name.

    The Message Types box resembles the following:

    Specify messge types for EAI bridges

  7. Save the bridge configuration.

Configure the Pre-Transform Enrich Stage

In the Enrich stage, you promote properties that are used in the solution to perform further processing on the message or for routing the message to the destination. As per the business scenario, there are two requirements for promoting the properties.

  • To extract the value in the QuoteAmount element in the request message schema: According to the Business Scenario, if the value for QuoteAmount is less than $10000, the message must be routed to RelayServiceA. Otherwise, it must be routed to RelayServiceB. So, in the Enrich stage, extract the value of the QuoteAmount and then later, while configuring how to route messages to the right service, use the extracted property value to specify the routing condition.

    Note

    The value for QuoteAmount element must be extracted from both the request schemas, ACORDRq1.xsd and ACORDRq2.xsd.

  • To extract the value in the Comments element in the request schema. In the section, To map NorthwindSchema.xsd to ACORDRs2.xsd, the Comments property is used to enter a value to the Comments node in the response schema, even though the property isn’t defined yet. The following procedure demonstrates how to define the Comments property in the Enrich stage.

    Note

    Extract the value for Comments element only from the ACORDRq2.xsd because the other request schema does not have the Comments node at all.

To extract and promote properties in the pre-Transform Enrich stage

  1. In the request bridge of the XML Request-Reply Bridge configuration, select the Enrich activity within the pre-Transform Enrich stage. Then, from the Properties window, select the ellipsis button (…) against Property Definitions.

  2. In Property Definitions, select Add to open the Add Property dialog box. In Add Property, do the following:

    TABLE REMOVED

    The Add Property dialog box resembles the following:

    XPath property extraction in EAI bridges

    Select OK.

  3. Repeat step 2 to extract the following properties in the Enrich stage:

    Element name in the schema

    Extract from schema

    Set property name to

    Set data type to

    QuoteAmount

    ACORDRq2.xsd

    QuoteAmount

    long

    Comments

    ACORDRq2.xsd

    Comments

    string

    Select OK in the Property Definitions dialog box.

  4. Save the bridge configuration.

Configure the Transform Stage in the Request Bridge

The procedure To map ACORDRq1.xsd and ACORDRq2.xsd to NorthwindSchema.xsd demonstrates how to create two Transforms to map the request messages to the Northwind’s request message format. This step demonstrates how to include the Transforms to the request bridge of the bridge configuration. The bridge uses the Transforms to process the message and then sends it to the relevant relay service.

To enter Transforms in a bridge

  1. In the XML Request-Reply Bridge configuration, select the Xml Transform activity within the Transform stage, and from the Properties window, select the ellipsis button (…) against the Maps property.

  2. The Maps Selection dialog box, by default, shows only those maps that have the source schema same as the request schema you specified earlier. For this tutorial, because the bridge must process and transform two request schemas, select both the Transforms you created (one to Transform ACORDRq1.xsd to NorthwindSchema.xsd and the other to Transform ACORDRq2.xsd to NorthwindSchema.xsd).

    Specify transforms for EAI bridges

  3. In Maps Selection, select OK. The maps you added are listed under the Selected Maps box on the bridge designer surface.

  4. Save the bridge configuration.

See Also

Step 4: Configure a Request-Reply Bridge