This blog is created to throw some lights on SAP CPI concepts, which experienced in my journey. Trying to explore more about HCI/Cloud platform integration/SCPI and sharing the contents to help you. Thanks for all Users your support. Please give your comments below ...
Tuesday, 8 August 2023
Find all the messages from the unformatted xml and place in newline
import com.sap.gateway.ip.core.customdev.util.Message;
import java.util.HashMap;
import groovy.xml.XmlUtil;
import groovy.util.*;
def Message processData(Message message) {
def body = message.getBody(java.lang.String) as String;
def xml = new XmlSlurper().parseText(body)
def error = xml.'**'.findAll { it.name() == 'message' }*.text().join('\n')
message.setBody(error);
return message;
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment