My concern with -noloading -- expressed in the thread commons-logging issue (maybe JUnit-related) -- had been that, if I have JUnit run more than one test case, the second and later cases will fail because they are generating cumulative data on the Axis server based on preceding tests rather than fresh data based only on the current test.
So I added to my web service interface a purge() operation to re-initialize the server data structures in memory. Then my client calls purge at the start of each test case. To reiterate, this hack is only necessary if you are running a series of JUnit test cases, and each test case relies on having an Axis web service in a just-initialized state.
At 22:01 10.12.02 -0800, you wrote:
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.