Hi all,

 

I’ve scoured this mailing list and the web hunting for a solution to this problem. I’ve got a fairly simple web service that returns an array of user defined objects. My service is being called using the .jws stuff so I’m not actually writing the WSDL for it. Everything seemed to be going well except in the XML response my arrays were being defined as:

 

soapenc:arrayType="ns2:anyType[11]" xmlns:ns2=http://www.w3.org/1999/XMLSchema

 

Rather then…

 

soapenc:arrayType="ns2:MyClass[11]" xmlns:ns2=http://MyNameSpace

 

I was able to get around this by adding to my server-config.wsdd file:

 

<typeMapping

        xmlns:ns="http://MyNameSpace"

        qname="ns:MyClass"

        type="java:com.test.MyClass[]"

        serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"

        deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"

        encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"

      />

 

This ALMOST fixed it but I also had trouble with the ArraySerializer. It would figure out that is had an object of com.test.MyClass[] and rather then looking for a mapping for that, it would figure out what type the components of the array were and look for a mapping for that instead.

 

By changing line 137 of ArraySerializer.java to read:

 

componentQName = context.getQNameForClass(cls);

 

instead of

 

componentQName = context.getQNameForClass(componentType);

 

I was end to make everything work. Now I assume I’m doing something wrong if I’ve got to change the AXIS source to force things to work. I’ve seen examples of type mappings like the one I have above and I just can’t see how they’d work with ArraySerializer the way it is now. Maybe someone can help shed some light on this for me?

 

Thanks for any help.

Steve

 

Reply via email to