I'm testing a method in my web service: public Parent addParent(String data)
A Parent object contains an array of Child objects, accessible through the
Parent's: public Child[] getChildrenAsArray()
When I run an Axis client directly and have it call my Axis server, this
call works fine. But when I run an Axis client launched through JUnit, I
get a weird, client-only error that the client can't convert a Child array
to itself:
Dec 10, 2002 7:16:16 PM org.apache.axis.encoding.ser.BeanPropertyTarget set
SEVERE: Could not convert [Lfoo.bar.Child; to bean field 'childrenAsArray',
type [Lfoo.bar.Child;
Dec 10, 2002 7:16:16 PM org.apache.axis.client.Call invoke
SEVERE: Exception:
java.lang.IllegalArgumentException: argument type mismatch
________at
org.apache.axis.encoding.ser.BeanPropertyTarget.set(BeanPropertyTarget.java:182)
________at
org.apache.axis.encoding.DeserializerImpl.valueComplete(DeserializerImpl.java:284)
________at
org.apache.axis.encoding.ser.ArrayDeserializer.valueComplete(ArrayDeserializer.java:533)
________at
org.apache.axis.encoding.DeserializerImpl.endElement(DeserializerImpl.java:541)
________at
org.apache.axis.encoding.DeserializationContextImpl.endElement(DeserializationContextImpl.java:961)
________at
org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:206)
________at
org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:693)
________at
org.apache.axis.encoding.DeserializerImpl.startElement(DeserializerImpl.java:404)
________at
org.apache.axis.encoding.ser.BeanDeserializer.startElement(BeanDeserializer.java:167)
________at
org.apache.axis.encoding.DeserializationContextImpl.startElement(DeserializationContextImpl.java:925)
...
I checked the SOAP request and response via TCPMon, and everything looked
kosher.
In my classpath for JUnit, I tried switching the order of:
* the directory for the WSDL2Java-generated client classes and
* the directory for the original server-side representations of these classes.
Same error with both orders.
One aside. I created a custom (de)serializer for the Parent class, because
the standard bean (de)serializer was having trouble with the Child[] field.
The above stack trace indicates that, on the client, the custom
deserializer is not being used; the bean one is instead. However, that may
also be true in the successful case of the Axis client being run directly.
- help: Nesting arrays & structs Dongsheng Song
- Re: help: Nesting arrays & structs Benjamin Tomasini
- Re: help: Nesting arrays & structs Mitch Gitman
- Re: help: Nesting arrays & structs Benjamin Tomasini
- Re: help: Nesting arrays & stru... David payam
- Re: help: Nesting arrays & stru... Mitch Gitman
- Re: client classloader confusion Mitch Gitman
- Re: client classloader confusion Mitch Gitman
- RE: help: Nesting arrays & structs Vidyanand Murunikkara