Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Web service client and array as input parameter

0 views
Skip to first unread message

mikp

unread,
Nov 26, 2009, 4:22:49 PM11/26/09
to
I am trying to create a web service client that accepts as operation input parameter an array of int. My code is

Service service = new Service();
Call call = (Call) service.createCall();

call.registerTypeMapping(ArrayList.class, XMLType.SOAP_ARRAY, new ArraySerializerFactory(), new ArrayDeserializerFactory());

call.setTargetEndpointAddress(new java.net.URL(endpoint));
call.setOperationName( "sortArray" );
call.addParameter("x", XMLType.SOAP_ARRAY, ParameterMode.IN);

call.setReturnType(XMLType.XSD_STRING);
ArrayList res = new ArrayList();
int x[] = {23,2,5,15,24};
for(int i=0;ix.length;i++) {
res.add(new Integer(x));
}

String ret = (String) call.invoke( new Object [] { res });

I am getting the error

java.lang.Exception: convert problem class java.util.ArrayList class [I


can anyone help?

0 new messages