Two Laptop Bag
The moose likes Web Services and the fly likes axis - array inside a bean deserialization Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Web Services
Reply Bookmark "axis - array inside a bean deserialization" Watch "axis - array inside a bean deserialization" New topic
Author

axis - array inside a bean deserialization

tomas xub
Greenhorn

Joined: Feb 16, 2006
Posts: 1
hi

i have got this class:

public class MyClass {

public String name;
public int level;
public Object[] objects;

public MyClass() {};

...

}

then, this service:

public MyClass returnMyClass()
{
MyClass mc = new MyClass();
mc.setLevel(10);
mc.setName("teneo");
Object [] o = {"hello","swallow"};
mc.setObjects(o);
return mc;
}

this mapping in deploy.wsdd file (generated standardly):
...
<typeMapping
xmlns:ns="urn:sk.dvd"
qname="ns:MyClass"
type="java:sk.dvd.MyClass"
serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactor=
y"
encodingStyle=""
/>
<arrayMapping
xmlns:ns="urn:sk.dvd"
qname="ns:ArrayOf_xsd_anyType"
type="java:java.lang.Object[]"
innerType="cmp-ns:anyType" xmlns:cmp-
ns="http://www.w3.org/2001/XMLSchema"
encodingStyle=""
/>
...

can someone tell me, how to write client to this webservice???
i have got something like this, but it works not

call.setOperationName("returnMyClass");

...
QName qn = new QName("urn:sk.dvd","MyClass");
Class cls = MyClass.class;

QName qn3 = new QName("urn:sk.dvd","ArrayOf_xsd_anyType");
Class cls3 = Object[].class;

call.registerTypeMapping(cls,qn,new BeanSerializerFactory(cls,qn),new
BeanDeserializerFactory(cls,qn));
call.registerTypeMapping(cls3,qn3,new ArraySerializerFactory(),new
ArrayDeserializerFactory());

call.setReturnType(qn);
...

service soap response looks like this:

<soapenv:Body>
<returnMyClassResponse xmlns="">
<returnMyClassReturn>
<level>10</level>
<name>teneo</name>
<objects>
<objects xsi:type=3D"xsd:string">hello</objects>
<objects xsi:type=3D"xsd:string">xello</objects>
</objects>
</returnMyClassReturn>
</returnMyClassResponse>
</soapenv:Body>


thanks, Tomas
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: axis - array inside a bean deserialization
 
Similar Threads
java.io.IOException: No serializer found for class
AXIS 1.4 Response XML Help-Urgent
Complex type arrays.. Please Help.. !!
Null Qualified name .. JAXRPCException while deploying a web service..
SOAPMessage: SAXParseException