pub.list:sizeOfList

pub.list:sizeOfList is failing and the error it produces is :com.wm.data.ISMemDataImpl cannot be cast to [Ljava.lang.Object;

Can anyone tell me what this error means?? I am passing the data from a listdocument to this service and capturing the output as size of a list in a sting variable.

Hi Monica,

are you sure you are passing an array object to sizeOfList. the error means that the input to the sizeOfList is not a List object…

HTH

I am facing a similar issue.

I have XML data as input to a service and it contains a document list somewhere inside. i use a pub.list:sizeOfList to get the size of this list (i have done XMLStringToXMLNode and XMLNodeToXMLDocument).

the service runs well when the input XML has multiple records for the document list,
but when the input XML file contains only one record in the document list, i get an error:

java.lang.ClassCastException: com.wm.app.b2b.services.CValues
at pub.list.sizeOfList(list.java:361)

Can anyone suggest what could be the problem?

In the call to XMLNodeToDocument you need to specify the IS document type name that the XML conforms to. That way the service will know to create a list even when only one entry is present.

Thanks Rob !! that was the perfect solution :slight_smile:

Specified the IS doc type and makeArrays=false

Thank you