axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mehdi Rabah" <mehdi.ra...@gmail.com>
Subject Re: [axis2 java client] ArrayList cannot be cast to Set
Date Wed, 16 Apr 2008 16:04:08 GMT
Hi Michele, thanks for your answer,

In fact, I'm sending a *Set* from my WebService, so I expect to receive a
*Set*. I've looked what contain the ArrayList I receive and it appear to be
an ArrayList of org.apache.axiom.om.impl.llom.OMTextImpl. It has nothing to
do with the basic Set of Integer I sent! Here is the soap response of my WS:

<ns:getLogEntry2Response
    xmlns:ns="http://eventlogger.ws"
    xmlns:ax21="http://interaction.ws/xsd"
    xmlns:ax22="http://util.java/xsd">
    <ns:return>0</ns:return>
    <ns:return>1</ns:return>
    <ns:return>2</ns:return>
</ns:getLogEntry2Response>

Don't tell me this is a java problem... and Rob, thanks for your kindness...

---
Mehdi


On Wed, Apr 16, 2008 at 5:47 PM, Michele Mazzucco <
Michele.Mazzucco@ncl.ac.uk> wrote:

> 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: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

Mime
View raw message