sorry - didn't realise you were talking about java.lang.Object

it may be that it works for an array because at run time the array happened
to be of a simple type for which you do not need to have a map - and then
for the scalar Object it didn't work because the run time type was more
complex and there was no serializer.

Nick


----- Original Message -----
From: "Milburn, Christopher FIL" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, December 05, 2001 10:28 AM
Subject: RE: returning Object vs Object[]


> I can see how this works with a class that we can map e.g. in your example
> 'samples.addressbook.Address' but what about returning the class
> 'java.lang.Object'
> We have a general Soap server that currently returns a
'java.lang.Object[]'
> but our clients want it to return a 'java.lang.Object' on which, they will
> then use instanceof to cast into the correct type, it just produces the
> error - 'No Serializer found to serialize a 'java.lang.Object'
> Thanks,
> Chris
>
> -----Original Message-----
> From: Nicholas Quaine [mailto:[EMAIL PROTECTED]]
> Sent: 04 December 2001 11:46
> To: [EMAIL PROTECTED]
> Subject: Re: returning Object vs Object[]
>
>
> both are possible
> ensure that your deployment descriptor contains a definition of only the
> basic object (ie. do not attempt to declare an array)
> the (de)serializer will work out how to do its work for any method that
> requires or returns an array of such objects
> as an example, the following excerpt from a deployment descriptor
'declares'
> an object called Address
> Once this is declared any method can then receive or return an Address or
an
> array of Address
>
> <isd:map
>   encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";
>   xmlns:x="urn:xml-soap-address-demo"
>   qname="x:address"
>   javaType="samples.addressbook.Address"
>   java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
>   xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer" />
>
> good luck
>
> regards,
> Nicholas Quaine
>
> Visit http://www.soapuser.com/
>
> [EMAIL PROTECTED]
>
>
> ----- Original Message -----
> From: "Milburn, Christopher FIL" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, December 04, 2001 10:14 AM
> Subject: returning Object vs Object[]
>
>
> > Why can I return an 'Object' array from my soap server but not an
'Object'
> > ie
> > This works ok...
> >
> > public Object[] processCommand( String[] soapParams )
> > {
> > ...
> >
> >     Object[] obj = {(Object)"Fred Bloggs", (Object)"Jim Smith"};
> >
> >     return( obj );
> > }
> >
> > but not this....
> >
> > public Object processCommand( String[] soapParams)
> > {
> > ...
> >
> >     Object obj = (Object)"Fred Bloggs";
> >
> >     return( obj );
> > }
> >
> >
> > It seems bizarre, Is this right ?
> >
> > Thanks,
> >
> > Chris Milburn
> > [EMAIL PROTECTED]
> > <mailto:[EMAIL PROTECTED]>
> >
>

Reply via email to