In this blog I will be testing the SAPODataConnector using the SAP Gateway - Demo Consumption System.

 

 

Overview

 

The SAPODataConnector enables the connection to the SAP Netweaver Gateway through the ODdata specification. It is a specialized implementation of the ODataConnector. See Integration Connectors for documentation.

 

It relies on three components :

    • Integration Runtime : microservice that runs outside of ThingWorx and has to be deployed separately, it uses Web Socket to communicate with the ThingWorx platform (similar to EMS).
    • Integration Subsystem : available by default since 7.4 (not extension needed)
    • Integration Connector : SAPODataConnector available by default in 8.0 (not extension needed)

 

ThingWorx can use OAuth to access SAP, but in this blog I will just use basic authentication.

 

SAP Netweaver Gateway Demo system registration

 

1. Create an account on the Gateway Demo system (credentials to be used on the connector are sent by email)

2. Verify that the account has access to the basic OData sample service : https://sapes4.sapdevcenter.com/sap/opu/odata/IWBEP/GWSAMPLE_BASIC/


Integration Runtime microservice setup

 

1. Follow WindchillSwaggerConnector hands-on (7.4) - Integration Runtime microservice setup

Note: Only one Integration Runtime instance is required for all your Integration Connectors (Multiple instances are supported for High Availability and scale).

 

SAPODataConnector setup

 

Use the New Composer UI (some setting, such as API maps, are not available in the ThingWorx legacy composer)

1. Create a DataShape that is used to map the attributes being retrieved from SAP

    • SAPObjectDS : Id (STRING), Name (STRING), Price (NUMBER)

2. Create a Thing named TestSAPConnector that uses SAPODataConnector as thing template

3. Setup the SAP Netweaver Gateway connection under TestSAPConnector > Configuration

    • Generic Connector Connection Settings
      • Authentication Type = fixed
    • HTTP Connector Connection Settings
      • Username = <SAP Gateway user>
      • Password = < SAP Gateway pwd>
      • Base URL : https://sapes4.sapdevcenter.com/sap
      • Relative URL : /opu/odata/IWBEP/GWSAMPLE_BASIC/
      • Connection URL : /opu/odata/IWBEP/GWSAMPLE_BASIC/$metadata

4. Create the API maps and service under TestSAPConnector > API Maps (New Composer only)

    • Mapping ID : sap
    • EndPoint : getProductSet
    • Select DataShape : SAPObjectDS (created at step 1) and map the following attributes :
      • Name <- Name
      • Id <- ProductID
      • Price <- Price
    • Pick "Create a Service from this mapping"

Testing our Connector

 

Test the TestSAPConnector::getProductSet service (keep all the input parameters blank)