on 10-05-2016 8:42 AM
Hi All,
Does anyone as used scripting right after XML2CSV converter ?
once csv comes as payload to scripting, in tracing i can see and confirm csv is passing on to the script.
But it still says " java.lang.NoSuchMethodException: No signature of method: java.io.ByteArrayOutputStream.readLines() is applicable for argument types: () values: []"
I am trying to read the payload which is csv as readLines . I am not sure the reason because when i hard code the flat file in content modifier body and read the lines in the script it executes successfully .
please find the screen shot for the same :
Input for the script:
And the script is as follows:
import com.sap.gateway.ip.core.customdev.util.Message;
import java.util.HashMap;
def Message processData(Message message) {
//Body
def body = message.getBody();
def BodyList = body.readLines();
def messageLog = messageLogFactory.getMessageLog(message);
def count=BodyList.size();
def gpid=''
if(count>0)
{
for(i=0;i<=BodyList.size-1;i++)
{
def line = BodyList[i]
personid=personid+','+line.split(",")[0]
}
messageLog.setStringProperty("inactive personid",''+personid);
}
message.setBody(body);
return message;
}
Thanks,
Pradeep KN
The following issue is resolved by reading the message as a string instead of getbody()
def body = message.getBody(java.lang.String); | |
def BodyList = body.readLines(); |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.