I have to make a call to a method of a web service via SSJS. One of the input parameters of the method is a structure array. The web service consumer is implemented in java. I would like to know how to declare and instantiate the java strucuture array in SSJS.
The signature of the method is:
(short , short , java.lang.String , java.lang.String , java.lang.String , java.lang.String , java.lang.String , java.lang.String , java.lang.String , short , java.lang.String , java.lang.String , ESTRUTURACHECKLIST[] )
I am creating the array as per your suggestion:
lst=new ArrayList();
var chk:xx.xxx.xxxx.xxxx.ESTRUTURACHECKLIST=new
xx.xxx.xxxx.xxxx.ESTRUTURACHECKLIST();
chk.setCONTEUDOCHECKLIST("XXXX");
chk.setDESCRICAOCHECKLIST("CÓDIGO USUÁRIO");
lst.add(chk);
var chk1:xx.xxx.xxxx.xxxx..ESTRUTURACHECKLIST=new
xx.xxx.xxxx.xxxx..ESTRUTURACHECKLIST();
chk1.setCONTEUDOCHECKLIST("TESTE");
chk1.setDESCRICAOCHECKLIST("NOME USUARIO");
lst.add(chk1);
var chk2:xx.xxx.xxxx.xxxx..ESTRUTURACHECKLIST=new
xx.xxx.xxxx.xxxx..ESTRUTURACHECKLIST();
chk2.setCONTEUDOCHECKLIST("TESTE NOTES");
chk2.setDESCRICAOCHECKLIST("NOME NOTES");
lst.add(chk2);
arr=lst.toArray();
When I created the structure array following its suggestion, the java method gives the error and does not recognize the last array. To be sure, I changed the signature of the class that instantiates the web service client by removing the array, there was no error. What I think is occurring is that the java class is not recognizing the array passed by the SSJS with an array of the specified structure.
The error calling the method is:
Error while executing Javascript action expression Script interpreter error, line=75, col=13: Java method 'xxxxx(number, number, string, string, string, string,string, string,string, string,string, [Ljava.lang.Object;)'on java class xx.xxxx.xxxx.xxx not found