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 McCaslin Orion <mc...@bah.com> on 2003/01/09 01:51:19 UTC

No deserializer defined for array type ?

Hi,

I am not having success getting an array of complex objects deserialized in
a simple test client.

Has anybody figured out how to solve this error?

org.xml.sax.SAXException: No deserializer defined for array type
{http://object.myObject}MyObject at
org.apache.axis.encoding.ser.ArrayDeserializer.onStartElement(ArrayDeseriali
zer.java:257)


The Service function:
public MyObject[] getMyObjects() {
      MyObject[] myObjArray = new MyObject[3];
	myObjArray[0]= new MyObject();
	myObjArray[1]= new MyObject();
	myObjArray[2]= new MyObject();
	return(myObjArray);
}

I've seen a few of these error postings w/o answers.

In another posting, a workaround was mentioned...
----------------------------------------------------
Define a class which holds your array, and make the
new class a bean. Something like this

class Folders {
	Folder[] folders;
      getter/setter functions
-----------------------------------------------------
Is this really the only way?

Many thanks,
Orion


Re: No deserializer defined for array type ?

Posted by Mark Mueller <ma...@yahoo.com>.
I've been trying to answer the same question myself.
Are we supposed to use:

    call.registerTypeMapping()

to do this?  Does anyone have an example of a client
that 
deserializes an array of objects?  

   Mark

--- McCaslin Orion <mc...@bah.com> wrote:
> Hi,
> 
> I am not having success getting an array of complex
> objects deserialized in
> a simple test client.
> 
> Has anybody figured out how to solve this error?
> 
> org.xml.sax.SAXException: No deserializer defined
> for array type
> {http://object.myObject}MyObject at
>
org.apache.axis.encoding.ser.ArrayDeserializer.onStartElement(ArrayDeseriali
> zer.java:257)
> 
> 
> The Service function:
> public MyObject[] getMyObjects() {
>       MyObject[] myObjArray = new MyObject[3];
> 	myObjArray[0]= new MyObject();
> 	myObjArray[1]= new MyObject();
> 	myObjArray[2]= new MyObject();
> 	return(myObjArray);
> }
> 
> I've seen a few of these error postings w/o answers.
> 
> In another posting, a workaround was mentioned...
> ----------------------------------------------------
> Define a class which holds your array, and make the
> new class a bean. Something like this
> 
> class Folders {
> 	Folder[] folders;
>       getter/setter functions
>
-----------------------------------------------------
> Is this really the only way?
> 
> Many thanks,
> Orion
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com