Recent project required make call to Concur REST API using PI REST adapter, get REST XML response, then do further processing. The REST XML response do not conform with message type/external definition defined, cause problem not able to process further in operation mapping and message mapping.

Below is coding written in message mapping, follow this concept “Write Java Mapping directly in ESR!

Brief explanation what it does:
Step 1 : Get source xml into inDoc using DOM method.
Step 2 : Get inDoc’s element “job”, remove unnecessary attributes.
Step 3 : Copy inDoc’s root to copiedRoot importNode function
Step 4 : Create new outDoc, add root element “ns0:ED_CONCUR_Job_Status_Response”
Step 5 : then add copiedRoot to outDoc’s root.
Step 6 : Generate target xml using transformer.transform function.

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

 

Done!

Manually Wrap Concur REST Response XML to follow SAP PI Message XML namespace
Tagged on:     

Leave a Reply

Your email address will not be published.

Time limit is exhausted. Please reload CAPTCHA.