Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Web Services (http://www.velocityreviews.com/forums/f64-asp-net-web-services.html)
-   -   Cannot serialize object of type System.Object[,]. Multidimensional arrays are not supported (http://www.velocityreviews.com/forums/t783777-cannot-serialize-object-of-type-system-object-multidimensional-arrays-are-not-supported.html)

john harkin 09-21-2004 07:57 AM

Cannot serialize object of type System.Object[,]. Multidimensional arrays are not supported
 
Hi,
I get this on server when trying to retun a 2 dim array.
I apprecaite that they are not supported as per
http://support.microsoft.com/default...b;en-us;316273

however i'm looking for as a work around as my web service is a layer
in front of an existing com object which cannot be changed and it
returns the 2 dim array.

All thoughts welcome.

JOhn

john harkin 09-23-2004 11:18 AM

Re: Cannot serialize object of type System.Object[,]. Multidimensional arrays are not supported
 
Hi,
Thanks very much for this and it worked.
I'm actually need to retun an object which could contain object[][].
One thing i notice


[WebMethod]
public object ReturnJaggedArrayAsObject()
{
object[][] numbers = new object[2][] { new object[] {2,"string1",
24.56}, new object[] {4,"string2", 56.78} };
object a = (object) numbers;
return a;

}

didn't work and got a serialisation error but when i added

[WebMethod]
public object[][] Fred()
{
object[][] numbers = new object[2][] { new object[] {2,"string1",
24.56}, new object[] {4,"string2", 56.78} };

return numbers;

}

to the source file i was able to call ReturnJaggedArrayAsObject.
It appears that by having Fred it knows about object[][] in wsdl.
Any way of achieving this without defining Fred?

Regards


"Christoph Schittko [MVP]" <INVALIDEMAIL@austin.rr.com> wrote in message news:<#$za3n9nEHA.2616@tk2msftngp13.phx.gbl>...
> You can return jagged arrays, i.e.
>
> System.Object[][] instead of System.Object[,].
>
> HTH,
> Christoph Schittko
> MVP XML
> http://weblogs.asp.net/cschittko
>
> > -----Original Message-----
> > From: john harkin [mailto:jjhnospam@yahoo.co.uk]
> > Posted At: Tuesday, September 21, 2004 2:58 AM
> > Posted To: microsoft.public.dotnet.framework.aspnet.webservic es
> > Conversation: Cannot serialize object of type System.Object[,].
> > Multidimensional arrays are not supported
> > Subject: Cannot serialize object of type System.Object[,].
> > Multidimensional arrays are not supported
> >
> > Hi,
> > I get this on server when trying to retun a 2 dim array.
> > I apprecaite that they are not supported as per
> > http://support.microsoft.com/default...b;en-us;316273
> >
> > however i'm looking for as a work around as my web service is a layer
> > in front of an existing com object which cannot be changed and it
> > returns the 2 dim array.
> >
> > All thoughts welcome.
> >
> > JOhn

>
> --



All times are GMT. The time now is 04:31 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.