You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by JC <jc...@praud.com> on 2003/11/10 17:21:53 UTC
Serializer not found for array of objects
Hi all,
I'm trying to send arrays of user defined objects to a service, and get this exception:
AXIS FAULT: java.io.IOException: No serializer found for class intmsg.IntMsg in registry org.apache.axis.encoding.TypeMappingImpl@633d51
Here is my deployment descriptor:
<deployment xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<service name="IntMsg" provider="java:RPC">
<parameter name="className" value="intmsg.Server"/>
<parameter name="allowedMethods" value="*"/>
<typeMapping
qname="myNS:IntMsg"
type="java:intmsg.IntMsg"
xmlns:myNS="urn:BeanService"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
/>
<typeMapping
qname="myNS:IntMsgArray"
type="java:intmsg.IntMsg[]"
xmlns:myNS="urn:BeanService"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"
/>
</service>
</deployment>
And my code:
IntMsg[] imt = new IntMsg[nbm];
(fill the array with IntMsg objects)
Service service = new Service();
Call call = (Call) service.createCall();
QName qn = new QName("urn:BeanService", "IntMsgArray");
call.registerTypeMapping(
IntMsg[].class,
qn,
new org.apache.axis.encoding.ser.ArraySerializerFactory(),
new org.apache.axis.encoding.ser.ArrayDeserializerFactory());
call.setTargetEndpointAddress(url);
call.setOperationName(new QName("IntMsgArray", "receiveArray"));
call.addParameter("imt", qn, ParameterMode.IN);
call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);
String result = (String) call.invoke(new Object[] { imt });
(the exception rises here)
It works well when I send the IntMsg objects one by one...
What did I miss ?
Best regards
--
Jean-Christophe Praud - http://shub-niggurath.com
Ph'nglui mglw'nafh Cthulhu n'gah Bill R'lyeh Wgah'nagl fhtagn!
Re: AW: Serializer not found for array of objects
Posted by JC <jc...@praud.com>.
Oops... You're right. It works better now.
Thank you :)
On Tue, 11 Nov 2003 09:22:53 +0100
"Wolfgang Vullhorst" <wv...@s-und-n.de> wrote:
> Hi,
> I think in your client's code you also have to register the typemapping
> for the intmsg.IntMsg object (BeanSerializer).
>
> Wolfgang
>
> -----Ursprungliche Nachricht-----
> Von: JC [mailto:jc@praud.com]
> Gesendet: Montag, 10. November 2003 17:22
> An: axis-user@ws.apache.org
> Betreff: Serializer not found for array of objects
>
>
> Hi all,
>
> I'm trying to send arrays of user defined objects to a service, and get this
> exception:
> AXIS FAULT: java.io.IOException: No serializer found for class intmsg.IntMsg
> in registry org.apache.axis.encoding.TypeMappingImpl@633d51
>
> Here is my deployment descriptor:
>
> <deployment xmlns="http://xml.apache.org/axis/wsdd/"
> xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
> <service name="IntMsg" provider="java:RPC">
> <parameter name="className" value="intmsg.Server"/>
> <parameter name="allowedMethods" value="*"/>
> <typeMapping
> qname="myNS:IntMsg"
> type="java:intmsg.IntMsg"
> xmlns:myNS="urn:BeanService"
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
> deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
> />
> <typeMapping
> qname="myNS:IntMsgArray"
> type="java:intmsg.IntMsg[]"
> xmlns:myNS="urn:BeanService"
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
> deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"
> />
> </service>
> </deployment>
>
>
> And my code:
>
> IntMsg[] imt = new IntMsg[nbm];
> (fill the array with IntMsg objects)
>
> Service service = new Service();
> Call call = (Call) service.createCall();
> QName qn = new QName("urn:BeanService", "IntMsgArray");
> call.registerTypeMapping(
> IntMsg[].class,
> qn,
> new org.apache.axis.encoding.ser.ArraySerializerFactory(),
> new org.apache.axis.encoding.ser.ArrayDeserializerFactory());
> call.setTargetEndpointAddress(url);
> call.setOperationName(new QName("IntMsgArray", "receiveArray"));
> call.addParameter("imt", qn, ParameterMode.IN);
> call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);
> String result = (String) call.invoke(new Object[] { imt });
> (the exception rises here)
>
> It works well when I send the IntMsg objects one by one...
>
> What did I miss ?
>
>
> Best regards
>
>
>
>
> --
> Jean-Christophe Praud - http://shub-niggurath.com
> Ph'nglui mglw'nafh Cthulhu n'gah Bill R'lyeh Wgah'nagl fhtagn!
>
>
--
Jean-Christophe Praud - http://shub-niggurath.com
Conseil & Développement Informatique http://www.praud.com
Ph'nglui mglw'nafh Cthulhu n'gah Bill R'lyeh Wgah'nagl fhtagn!
AW: Serializer not found for array of objects
Posted by Wolfgang Vullhorst <wv...@s-und-n.de>.
Hi,
I think in your client's code you also have to register the typemapping
for the intmsg.IntMsg object (BeanSerializer).
Wolfgang
-----Ursprungliche Nachricht-----
Von: JC [mailto:jc@praud.com]
Gesendet: Montag, 10. November 2003 17:22
An: axis-user@ws.apache.org
Betreff: Serializer not found for array of objects
Hi all,
I'm trying to send arrays of user defined objects to a service, and get this
exception:
AXIS FAULT: java.io.IOException: No serializer found for class intmsg.IntMsg
in registry org.apache.axis.encoding.TypeMappingImpl@633d51
Here is my deployment descriptor:
<deployment xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<service name="IntMsg" provider="java:RPC">
<parameter name="className" value="intmsg.Server"/>
<parameter name="allowedMethods" value="*"/>
<typeMapping
qname="myNS:IntMsg"
type="java:intmsg.IntMsg"
xmlns:myNS="urn:BeanService"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
/>
<typeMapping
qname="myNS:IntMsgArray"
type="java:intmsg.IntMsg[]"
xmlns:myNS="urn:BeanService"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"
/>
</service>
</deployment>
And my code:
IntMsg[] imt = new IntMsg[nbm];
(fill the array with IntMsg objects)
Service service = new Service();
Call call = (Call) service.createCall();
QName qn = new QName("urn:BeanService", "IntMsgArray");
call.registerTypeMapping(
IntMsg[].class,
qn,
new org.apache.axis.encoding.ser.ArraySerializerFactory(),
new org.apache.axis.encoding.ser.ArrayDeserializerFactory());
call.setTargetEndpointAddress(url);
call.setOperationName(new QName("IntMsgArray", "receiveArray"));
call.addParameter("imt", qn, ParameterMode.IN);
call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);
String result = (String) call.invoke(new Object[] { imt });
(the exception rises here)
It works well when I send the IntMsg objects one by one...
What did I miss ?
Best regards
--
Jean-Christophe Praud - http://shub-niggurath.com
Ph'nglui mglw'nafh Cthulhu n'gah Bill R'lyeh Wgah'nagl fhtagn!