The solution was to use a Simple(De)SerializerFactory instead of a Bean(De)SerializerFactory, with the first signature I've tested on the server side.
Olivier Gauwin wrote:
Hi,
This problem seems really easy but I can't find a solution...
I try to use this WSDL type :
<xsd:simpleType name="Interop.Number">
<xsd:restriction base="xsd:int"/>
</xsd:simpleType>
I use this Typemapping :
<typeMapping
xmlns:ns="http://Interop/xsd"
qname="ns:Interop.Number"
type="java:Interop.Number"
serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
/>
The SOAP request looks like :
<multiRef xsi:type="ns2:Interop.Number" ...>12</multiRef>
I've tried to use (on the server side) these 2 methods :
- public Interop.Number echo(Interop.Number nb) {...}
raises:
AxisFault
faultCode: {http://xml.apache.org/axis/}Server.userException
faultString: java.lang.NullPointerException
faultActor: null
faultDetail:
stackTrace: java.lang.NullPointerException
at org.apache.axis.encoding.ser.SimpleDeserializer.onEndElement(SimpleDeserializer.java:223)
at org.apache.axis.encoding.DeserializerImpl.endElement(DeserializerImpl.java:495)
...
This NullPointerException is raised by Axis, not by the method code (it is not executed at all).
and
- public int echo(int nb) {...}
raises:
AxisFault
faultCode: {http://xml.apache.org/axis/}Server.userException
faultString: org.xml.sax.SAXException: Bad types (class Interop.Number -> int)
faultActor: null
faultDetail:
stackTrace: org.xml.sax.SAXException: Bad types (class Interop.Number -> int)
at org.apache.axis.message.RPCHandler.onStartChild(RPCHandler.java:285)
...
which is quite logical.
Any pointer would be apprecated...
Thanks,
Olivier.
