[EMAIL PROTECTED] wrote:
we were having the same problems.

we actually went in and modified the generated files and that took care of
it. So just change the method signature for the getters and the setters and
change the equals and hashmap and it nicely converst the Arrays to the say
ArrayList etc and returns it.


Thanks for the info. However, I'm not exactly sure what you're referring to -- it seems that you're
talking about the classes generated from wsdl2java? I've never actually done it that way --
my call looks like this:


Service service = ServiceFactory.newInstance().createService(wsdlUrl, serviceQname)
ServiceInterface proxy = service.getPort(ServiceInterface.class)
proxy.pleaseWork()


Either way, it seems that your suggestion may be a good workaround for the time being --
I'll look into it. Manually modifying the proxies would be kind of annoying though, since
we have at least 10 service classes with 5 or so methods apiece that deal
with collections. I was thinking that I could do something sneaky with the typemappings,
but I've only used those for my custom beans, not arrays/collections.


Thanks again!




|---------+---------------------------->
|         |           [EMAIL PROTECTED] |
|         |                            |
|         |           05/21/2004 01:22 |
|         |           PM               |
|         |           Please respond to|
|         |           axis-user        |
|         |                            |
|---------+---------------------------->
  
>---------------------------------------------------------------------------------------------------------------|
  |                                                                                    
                           |
  |       To:       [EMAIL PROTECTED]                                                  
                     |
  |       cc:                                                                          
                           |
  |       Subject:  is it possible to use Collections with client proxies?             
                           |
  
>---------------------------------------------------------------------------------------------------------------|




I've recently attempted to switch the way that I create my web service clients, from manually configuring Call objects, to obtaining a reference to an instance of the service interface as a stub/proxy. However, I am unable to get this working when a method has a Collection as a return type or parameter.

Before, I believe that the call to:
Call.setReturnType(Collection.class)
was instructing Axis to handle these types correctly.

However now, since I'm invoking service methods directly on an
interface, I get a ClassCastException on the client side, after the data
has been returned.  If I call a method that returns an array, it works
fine.

When attempting to invoke a method which includes a Collection as a
parameter, I get the following error:

Caused by: org.xml.sax.SAXException: No deserializer defined for array
type {http://localhost:8080/axis/services/Iava}ArrayOf_tns3_anyType
             at
org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:223)

             at
org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:130)

             at
org.apache.axis.encoding.DeserializationContextImpl.endElement(DeserializationContextImpl.java:1053)

             at com.bluecast.xml.Piccolo.reportEndTag(Piccolo.java:1059)
             at
com.bluecast.xml.PiccoloLexer.parseCloseTagNS(PiccoloLexer.java:2154)
             at
com.bluecast.xml.PiccoloLexer.parseTagNS(PiccoloLexer.java:1338)
             at
com.bluecast.xml.PiccoloLexer.parseXMLNS(PiccoloLexer.java:1272)
             at
com.bluecast.xml.PiccoloLexer.parseXML(PiccoloLexer.java:1240)
             at com.bluecast.xml.PiccoloLexer.yylex(PiccoloLexer.java:4754)
             at com.bluecast.xml.Piccolo.yylex(Piccolo.java:1253)
             at com.bluecast.xml.Piccolo.yyparse(Piccolo.java:1363)
             at com.bluecast.xml.Piccolo.parse(Piccolo.java:702)
             at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
             at
org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:218)

             at
org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:568)
             at org.apache.axis.Message.getSOAPEnvelope(Message.java:427)
             at org.apache.axis.client.Call.invokeEngine(Call.java:2708)
             at org.apache.axis.client.Call.invoke(Call.java:2671)
             at org.apache.axis.client.Call.invoke(Call.java:2357)
             at org.apache.axis.client.Call.invoke(Call.java:2280)
             at org.apache.axis.client.Call.invoke(Call.java:1741)
             at
org.apache.axis.client.AxisClientProxy.invoke(AxisClientProxy.java:156)


Thanks in advance for any help or information that anyone can provide. I've started to read that Collections aren't directly supported by JAX-RPC, or SOAP. Is this true? It looks like I should start switching my methods to return arrays instead of collections, but I'd prefer to find a workaround for now.

Reply via email to