> Object[] response = serviceClient.invokeBlocking > (opFindEntry, > opFindEntryArgs, returnTypes); > > Set result = (Set) response[0];
Try casting the ArrayList to a "Collection" and then use an iterator on the Collection.. Without being unkind (and I really mean that), I think a java tutorial explaining the fundamentals would fill in the missing gaps.. -----Original Message----- From: Michele Mazzucco [mailto:[EMAIL PROTECTED] Sent: 16 April 2008 16:48 To: [email protected] Subject: Re: [axis2 java client] ArrayList cannot be cast to Set This is a java problem, it has nothing to do with web services. You cannot cast an ArrayList to a Set!, they have different features. Try to send/receive array of values and work with your set after that. Michele On 16 Apr 2008, at 16:37, Mehdi Rabah wrote: > Hi everyone, I'm a new user of webservices/axis/soap, etc. > > I've deployed a simple WS (using axis2) which return a set, and I > want to deserialize it in my java client (also using axis2). But I > get this error : > > Exception in thread "main" java.lang.ClassCastException: > java.util.ArrayList cannot be cast to java.util.Set > > Is this a common error ? If so, can you point me some doc which I > must positively absolutely read to avoid basic problems like this ? > > Thanks in advance, > -- > Mehdi > ------- > > here is a part of my java lient code > > RPCServiceClient serviceClient = new RPCServiceClient(); > > Options options = serviceClient.getOptions(); > > EndpointReference targetEPR = new EndpointReference > (endPointStr); > options.setTo(targetEPR); > > QName opFindEntry = new QName(namespaceStr, methodNameStr); > > Object[] opFindEntryArgs = new Object[] { }; > > Class[] returnTypes = new Class[] { Set.class }; > > > Object[] response = serviceClient.invokeBlocking > (opFindEntry, > opFindEntryArgs, returnTypes); > > Set result = (Set) response[0]; --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] If you've received this email by mistake, we're sorry for bothering you. It may contain information that's confidential, so please delete it without sharing it. And if you let us know, we can try to stop it from happening again. Thank you. We may monitor any emails sent or received by us, or on our behalf. If we do, this will be in line with relevant law and our own policies. Sage (UK) Limited. Registered in England at North Park, Newcastle upon Tyne, NE13 9AA. Registered number 1045967. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
