Hi Luciana,
I've also seen that you can parse the OMElement ArrayList and get the values
that were in the set, but I'm working with objects which contains sets, so I
get an error before being able to parse that.. :
xception in thread "main" java.lang.IllegalArgumentException: argument type
mismatch
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.apache.axis2.databinding.utils.BeanUtil.deserialize(BeanUtil.java:391)
at
org.apache.axis2.databinding.utils.BeanUtil.processObject(BeanUtil.java:655)
at
org.apache.axis2.databinding.utils.BeanUtil.ProcessElement(BeanUtil.java:603)
at
org.apache.axis2.databinding.utils.BeanUtil.deserialize(BeanUtil.java:535)
at
org.apache.axis2.rpc.client.RPCServiceClient.invokeBlocking(RPCServiceClient.java:103)
at ClientAxis2.run(ClientAxis2.java:89)
at ClientAxis2.main(ClientAxis2.java:99)
I'm starting to run out of ideas.
No one ever transmistted an object with a set using AXIS ??? (and I'm afraid
to talk about (hash)maps)
Regards,
--
Mehdi
On Thu, Apr 17, 2008 at 2:56 PM, Lucy T. <[EMAIL PROTECTED]> wrote:
>
> I have partially resolved the problem:
>
> Server side (web service):
>
> import java.util.HashSet;
> import java.util.Set;
>
> public class ProvaSet {
>
> public Set<String> provaSet()
> {
> Set<String> s = new HashSet<String>();
> s.add("Pippo");
> s.add("Pluto");
> s.add("Paperino");
> s.add("Topolino");
>
> return s;
> }
>
> }
>
>
> Client invocation:
>
> RPCServiceClient serviceClient;
> try {
> serviceClient = new RPCServiceClient();
>
> Options options = serviceClient.getOptions();
> EndpointReference targetEPR = new
> EndpointReference(webServiceURI);
> options.setTo(targetEPR);
> QName opProvaSet = new QName("http://proveLuciana",
> "provaSet");
>
> Object[] opProvaSetArgs = new Object[] { };
> Class[] returnTypes = new Class[] { Set.class };
>
> Object[] response =
> serviceClient.invokeBlocking(opProvaSet,
> opProvaSetArgs, returnTypes);
>
> Collection result = (Collection) response[0];
> System.out.println("\nTipo dell'oggetto result: " +
> result.getClass());
> Iterator iter = (Iterator) result.iterator();
>
>
> while (iter.hasNext())
> {
>
> OMText s = (OMTextImpl) iter.next();
>
> }
>
> } catch (AxisFault e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> }
>
>
>
> Now the problem is that returns only the first element of Set Collection
> (that is element "Pippo").
> I'm working on this.
>
> Hope this helps.
>
> Regards,
> Luciana
>
> --
> View this message in context:
> http://www.nabble.com/-axis2-java-client--ArrayList-cannot-be-cast-to-Set-tp16726826p16743976.html
> Sent from the Axis - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>