remove anything from string cpi input string.
this blog useful for only string
SAP Cloud Integration (CPI/HCI) || Writing Groovy Scripts _ With Basic Examples | SAP Blogs
import com.sap.gateway.ip.core.customdev.util.Message;
import java.util.HashMap;
def Message processData(Message message)
{
def removal=message.getBody(java.lang.String) as String;
removal=removal.replace(/<?xml version="1.0" encoding="UTF-8"?>/,"");
message.setBody(removal);
return message;
}
testing purpose
-----------------------------------------------------
import com.sap.gateway.ip.core.customdev.util.Message
def Message processData(Message message) {
def removal = message.getBody(java.lang.String) as String
removal = removal.replaceAll('xmlns:prx="urn:sap.com:proxy:RE1:/1SAI/TAS4E662B8C2E7563F4F897:740"', "")
// Add more replacements if needed using removal.replaceAll()
message.setBody(removal)
return message
}