• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

axis - array inside a bean deserialization

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic