Integration gateway is a component in SAP Mobile Platform 3, it converts different types of protocols to Odata protocol. It is based on SAP Lean Java Server, it enables easy and convenient access to SAP and non SAP systems. This helps the developer to consume the services in a harmonized manner.
Integration Gateway comprises design-time tools for modelling and defining new Odata services from different systems. The design-tool is based on Eclipse, that enable you to build Odata models. How to Configure in Eclipse?
It also has a Runtime that allows you to run the newly created Odata services against the associated backend systems.
From SMP 3 SP04, Integration Gateway supports writing custom script while modeling Odata. It helps to modify the requests and responses. The supported scripts are Javascript and Groovy.
In this example SOAP is converted into Odata and an Odata Query is created using Custom Script.
WSDL file used: http://www.webservicex.net/medicareSupplier.asmx?WSDL
If you are new to Integration Gateway try this first :How to connect SOAP WebServices with Integration Gateway
function processRequestData(message) {
importPackage(com.sap.gateway.ip.core.customdev.logging);
importPackage(com.sap.gateway.ip.core.customdev.util);
importPackage(org.apache.olingo.odata2.api.uri);
importPackage(java.util);
importPackage(com.sap.gateway.core.ip.component.commons);
importPackage(com.sap.gateway.ip.core.customdev.api);
var parentMap = new LinkedHashMap();
parentMap.put("key:City","california");
//Set the message body back
message.setBody(parentMap);
//Logger
importPackage (com.sap.gateway.ip.core.customdev.logging);
log.logErrors(LogMessage.TechnicalError, "This is first log"+message.getBody().toString());
return message;
}
Calling the log API inside the function processRequestXML will record the request logs (payload) in SMP server logs.
Example:
function processRequestXML(message) {
//Logger
importPackage (com.sap.gateway.ip.core.customdev.logging);
log.logErrors(LogMessage.TechnicalError, "This is first log"+message.getBody().toString());
return message;
}
Log can be accessed from SMP Admin cockpit or in the server installation path. Compare the xml payload created with the SOAP UI payload to troubleshoot.
More Exercises:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
10 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
6 | |
5 | |
5 |