Recent project required to do a REST Lookup inside Java Mapping.
At ESR side, the input stream Need to be in XML format. The output stream in this example is XML format as well.
At ID side, Beside creating receiver REST communication channel R_REST_TargetSystem_TargetRESTAPI, need to create receiver agreement for this communication channel. If the response from REST call is JSON and Java Mapping expect XML format, then tick “Convert to XML” and “Add Wrapper Element”, at Element name and namespace, put Message Type and corresponding namespace.
Can repackage below code inside an UDF too, it will work just fine.

import added:
com.sap.aii.mapping.api.*
com.sap.aii.mapping.lookup.*
com.sap.aii.mappingtool.tf7.rt.*
java.io.*
java.lang.reflect.*
java.util.*
javax.xml.parsers.*
javax.xml.transform.*
javax.xml.transform.dom.*
javax.xml.transform.stream.*
org.w3c.dom.Document
org.w3c.dom.NodeList
org.w3c.dom.Node
org.w3c.dom.Element

 

Reference: https://blogs.sap.com/2015/09/11/yes-rest-lookup-is-possible-in-pi

REST Lookup using Java Mapping or UDF
Tagged on:         

Leave a Reply

Your email address will not be published.

Time limit is exhausted. Please reload CAPTCHA.