Share via


Step 2: Expose a Relay Endpoint to Invoke Operations on ORDERS05 IDOC

 

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:

There are two main steps required to expose an SAP artifact as an operation that can be invoked by sending a message over Service Bus – create an LOB Target and an LOB Relay.

  • An LOB Target defines how an Azure application communicates to the Line-of-Business (LOB) system. The LOB Target controls the LOB system connection URI, the operation to perform, and the connection credentials.

  • An LOB Relay is a WCF service running within an organizations firewall and listens to a relay endpoint on the Service Bus. As the name suggests, the LOB Relay acts as a relay between the Service Bus relay endpoint and the LOB system. It receives the message at the Service Bus relay endpoint and passes it on to the relevant LOB system using the LOB Target configuration.

For more information, see BizTalk Adapter Service Architecture. In this topic, we create an LOB Target and an LOB Relay to expose the Send operation on the ORDERS05 IDOC.

To create an LOB Target and LOB Relay

  1. Open Visual Studio (as an administrator), create a new BizTalk Service project, and name it SAPIntegration.

  2. You first start with adding a BizTalk Adapter Service server. This is the server where you installed the Runtime component of BizTalk Adapter Service. To add a BizTalk Adapter Service server, from the Server Explorer in Visual Studio, right-click BizTalk Adapter Services, and select Add BizTalk Adapter Service. In the Add BizTalk Adapter Service dialog box, enter the URL of the WCF service that monitors that Service Bus relay service, and then select OK:

    Add Service Bus Connect Server

    Because you have all the components of BizTalk Adapter Service installed on the same computer, the URL for that service will be https://localhost:8080/BAService/ManagementService.svc/.

    Note

    If you had installed BizTalk Adapter Service Runtime component on a separate computer, you replace ‘localhost’ in the above URL with the name of that computer.

  3. In this tutorial, we are creating an application to integrate with SAP, so we must add an SAP target. Expand the newly added server, expand LOB Types, right-click SAP, and select Add SAP Target:

    Add an SAP Target

    The Add a Target wizard starts. Perform the following steps to create an LOB Target.

    1. Read the information on the Before You Begin page, and then select Next.

    2. On the Connection Parameters page, specify the details for the SAP Server to connect to and the credentials to use for the connection. Select Next.

    3. On the Operations page, expand the ORDERSO5 IDOC category (under \IDOC\ORDERS\). There are several versions of the IDOC available. For this tutorial, we’ll select ORDERS05.V3(700). Expand this IDOC, select Send, and then select the right arrow to add it to the Selected Operations box:

      Add Send operation for IDOC

      Select Next.

    4. In the Runtime Security page, specify the security mechanism to be used by the LOB Server to authenticate the target resource when a message arrives from a client. For this tutorial, select Fixed Username and specify the credentials to connect to the SAP server.

    5. On the Deployment page, you create an LOB Relay and an LOB Target to provide connectivity to your on-premise LOB applications from the cloud.

      Select the Create new option to create a new relay and provide the following values:

      Name

      Description

      Namespace

      Specify the Service Bus namespace on which the LOB relay endpoint is created.

      Issuer name

      Specify the issuer name for the Service Bus namespace

      Issuer secret

      Specify the issuer secret for the Service Bus namespace

      Relay path

      Specify a name for the relay. For this tutorial, enter sapintegration01.

      Target sub-path

      Enter a sub-path to make this target unique. For this tutorial, enter orders.

      The Target runtime URL read-only property displays the URL where the relay is deployed on Service Bus. This is the path where you could send a message to be inserted into the on-premises SAP Server. In our scenario, this is where the bridge sends the message.

      Select Next.

    6. On the Summary page, review the values you specified in the previous steps, and then select Create.

    7. When the wizard completes, select Finish.

      In Visual Studio Server Explorer, you now have an entry under the SAP node. This represents the relay endpoint created in Service Bus to relay PO messages coming from the cloud to the on-premises SAP system.

To add schemas

  1. After adding the relay endpoint to an SAP system, you must add schemas that to send ORDERS05 PO messages to the SAP server. To add the schemas, right-click the relay endpoint and select Add schemas to SAPIntegration. In the dialog box, do the following:

    • Enter a filename prefix that will be included in the name of each schema file that is generated. For this tutorial, specify this as SAPIntegration_.

    • Enter a folder name that will be added to your solution under which all the schemas will be added. For this tutorial, specify the folder name as LOB Schemas.

    • Enter the credentials to connect to an SAP system.

    Add schemas to the project

    Select OK. The schemas are added to the project under an LOB Schemas folder.

To use the LOB Target

  1. Right-click anywhere on the BizTalk Service project design area, select Properties and update the BizTalk Service URL property to include your BizTalk Services name. This is the name that you provided in Azure classic portal while provisioning the BizTalk Services.

  2. Set the security property for the relay endpoint:

    1. Right-click the LOB Target in Server Explorer and select Properties.

    2. In the Properties grid, select the ellipsis (…) against the Runtime Security property.

    3. In the Edit Security dialog box, select Fixed Username, and enter the username and password to connect to the SAP Server.

    4. Select OK.

  3. Drag and drop the LOB Target onto the design area. Note the Entity Name property of the LOB Target. The default value is Relay-Path_target-sub-path. If using the examples above, it is sapintegration01_orders.

  4. Open the .config file for the LOB Target, which typically has the naming convention as YourRelayPath_target-sub-path.config. Specify the Service Bus issuer name and issuer secret, as shown below:

    <tokenProvider>
      <sharedSecret issuerName="owner" issuerSecret="issuer_secret" />
    </tokenProvider>
    

    Save changes to the config file.

See Also

Tutorial: Using Azure BizTalk Services to Integrate with an On-Premises SAP Server