This document describes how to create an inbound interface using SKYVVA REST query mode in SAP PI/PO with SKYVVA connector module.
What Is REST Query?
REST query -This is the new type we support and we can handle bigger sizes as the searchService. This is possible because Salesforce held the cursor and can return the result page by page. In our module, we can collect the result set and combine it to a new message.
The SKYVVA search will internally work on your query and will provide the complete result from your query.
You can configure in your Interface with operationType as “REST Query“ or “REST Query All“ to use REST Query feature. Then you need to configure your SQOL in the SKYVVA interface. Base on your configuration in Interface SkYVVA connector will automatically detects the operation type and work accordingly with the same search operation.
2. SKYVVA interface creation
Create an inbound interface, for example, “RESTQueryTest_IN” as shown below.
Select the Operation type as REST Query” or “REST Query All”
In this example we are going to put the SQL statement in the Skyvva Interface.
Now save the interface and download the WSDL.
Step 3 – Import WSDL into ESR
First, we have to create a namespace in ESR like “http://SAP_to_SF_RESTQueryTest“.
Now create an external definition under the namespace like below.Here the WSDL is for RESTQueryTest. So, we can give the name as ED_RESTQuery_Req
Here instead of WSDL from salesforce we can use our own message type in this example like below.
Here we are going to use only one interface for both Request and Response.
Import the WSDL and save and activate the external definition.
- Sender request data type
Create sender request data type as shown below
Sender response datatype –
after creating the source data type click on save and activate.
- Source request message type
Create the request message type as shown below:
- Source response message type
Create the response message type as shown below:
- Outbound Service Interface
Create an Outbound service interface, in that select category as outbound and select the respective message type.
then save and activate the outbound service interface.
- Inbound Service Interface
Create an inbound service interface, in that select category as inbound and select the respective external definition.
Save and active the inbound service interface.
- Request Message Mapping
Create request message mapping as shown below:
The different way to put the SELECT statement
Here we are able to build the select statement dynamically by the pi mapping. Thus we need a field in the request payload which for example is called ‘SKYVVA__SOQL_SELECT’ and where we can build the SELECT-statement by using concat formula in the mapping. In this case, you are taking the value from this field and it will dominate the SELECT-statement on the module parameter.
In the request WSDL we need to add SKYVVA system field e.g. ‘SKYVVA__SOQL_SELECT’ and build dynamically the SELECT in the mapping.
We have at 3 different places to put the SELECT statement e.g.:
- In the interface
- In the module parameter
- In the PO request mapping in the field ‘SKYVVA__SOQL_SELECT’ .
Here is the SQL Statement used in SKYVVA interface.
SELECT BillingCity,BillingCountry,BillingPostalCode,BillingState,BillingStreet,Description,Fax,Id,Name,Phone,skyvvasolutions__SAP_Distribution_Channel__c,skyvvasolutions__SAP_Division__c,skyvvasolutions__SAP_Sales_Org__c FROM Account where skyvvasolutions__SAP_Distribution_Channel__c = ‘{!skyvvasolutions__SAP_Distribution_Channel__c}’ and skyvvasolutions__SAP_Sales_Org__c = ‘{!skyvvasolutions__SAP_Sales_Org__c}’ and skyvvasolutions__SAP_Division__c = ‘{!skyvvasolutions__SAP_Division__c}’
- Response Message Mapping
Create response message mapping as shown below:
Insert the respective source and target structure and then do the mapping.
Now save and activate the message mapping.
- Operation Mapping
Create Operation mapping as shown below
Select the respective outbound and inbound service interfaces and also the message mapping for request and response then save and activate the operation mapping.
Creation of Integrated Configuration Objects
After creating the objects in ESR. We have to configure these objects in the integration directory.
First, we have to create Configuration Scenario.
An Integration scenario has the following objects.
- Business System for Sender and Receiver
- Sender and Receiver Communication channel
- Integrated Configuration
These are the objects we should create.
Since in this example we are using SOAPUI as source system. So need to create Business component for SOAPUI as BC_SOAPUI. For Salesforce you can use our proposal “Salesforce” as the business system. We have to import these business systems from SLD.
Configuring the Sender SOAP communication channel
Create sender communication channel as shown below.
Since we are using SOAP UI as a source. So, here we are using SOAP in the sender channel.
Provide the necessary details as shown and then save and activate the channel.
- Configuring the SOAP receiver channel
Configuration for Tab “General”
Specify the parameters as shown in the above screenshot.
Below is the configuration for the “Advanced” Tab.
The value “TserverLocation” has to be entered for the parameter Variable Header (XHeaderName1).
Below are the settings for Tab “Module”. Here, the SKYVVA module containing the logic for session handling must be specified.
We need 3 modules in the soap receiver channel e.g.
1. SFDC_Query_REQUEST -> prepare the execution of the REST and BUK query and pass the message payload to the 3. module
2. XISOAPAdapterBean -> calling our new soap API ‘RouteRequest’ to just pass back the request from the 1. module
3. SFDC_Query_RESULT -> here we only fetching the result which has been executed
The below parameters has the following meaning.
Integrated Configuration
Create integrated configuration objects as shown below.
Enter the required data e.g. the Communication Component, Interface and Namespace and then click on create button to create an ICO.
Now go through the tabs from left to right to configure the relevant objects. In this first tab “Inbound Processing” here we have to specify the sender communication channel.
Here in the “Receiver” tab, we have to specify the receiver business system.
In Receiver interfaces tab specify the operation mapping.
In the “outbound processing” tab, we have to specify the receiver channel.
- Test the Inbound Interface.
Triggering the data from the Source system.
Here is the result from Salesforce.