Dynamically providing URL and action values to receiver SOAP communication channel
In this Blog I would like to explain how to provide the URL and Action values dynamically to the receiver SOAP communication channel.
Scenario: ABAP Proxy to SOAP Synchronous scenario.
Requirement: Get the currency conversion (exchange) rates by requesting one of the web services (Xignite), Here we have 3 types of scenarios are there
- Get the daily conversion rates
- Get the monthly average conversion rates
- Get the month end conversion rates
We are using one SOAP sender communication (XI as message protocol) channel for all the 3 types of scenarios. Initially we thought to create 3 separate SOAP receiver communication channels for 3 scenarios because the action and URL is different for all those 3 scenarios, Later tried to use single communication channel and provided the URL and action dynamically.
For every scenario, sender side we creates 2 data types for Request and Response and receiver side we are using WSDL methods.
Similarly we create Message types and Service interfaces
In request mapping we need to create one UDF to dynamically provide the URL and action parameters
Created simple type UDF (dynamicallyProvidingURLAndAction), this UDF takes 2 inputs, First one is for the URL and second one is for Action.
UDF is as follows
DynamicConfiguration conf = (DynamicConfiguration)container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key=DynamicConfigurationKey.create(“http://sap.com/xi/XI/System/SOAP“, “TServerLocation”);
- conf.put(key, url);
- conf.put(key, action);
This UDF output map to the root node of target structure
We provided below 2 values as input to the UDF
URL value is http://www.xignite.com/xCurrencies.asmx
Action value is http://www.xignite.com/services/GetRealTimeCrossRates
For other 2 scenarios in requesting mapping UDF, these 2 input values are different.
Business system/service, Sender communication channel and integrated configurations are normal.
Target URL parameter is the mandatory field so we can give any value (at runtime it is replaced by the value which is provided in request mapping), and no need to give any value at action field because it is not a mandatory parameter. If any credentials required to login to web service then we can give those credentials by selecting checkbox of “Configure user Authentication”.
In advanced tab, we need to select the Use adapter specific message attributes and Variable transport binding check boxes then provide the values (these values we used in the Dynamic configuration UDF). At runtime TServerLocation parameter takes the URL value from dynamic UDF and THeaderSOAPACTION parameter takes the action value from dynamic UDF.
Scenario configuration is completed.
Input from Sproxy transaction of ECC system
I believe this blog would provide better understanding of how to provide the URL and Action values to Receiver SOAP communication channel in order to create n-number of receiver communication channels for a same web-service.