This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

axis - array inside a bean deserialization  RSS feed

 
tomas xub
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • 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
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!