You can return jagged arrays, i.e.
System.Object[][] instead of System.Object[,].
HTH,
Christoph Schittko
MVP XML
http://weblogs.asp.net/cschittko
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
> You can return jagged arrays, i.e.
>
[quoted text clipped - 28 lines]
>
> --
Christoph Schittko [MVP] - 29 Sep 2004 04:25 GMT
Have you tried declaring the array via an Xml serialization attribute on
the return value:
[WebMethod]
[return: XmlElement(typeof(object[][]))]
public object ReturnJaggedArrayAsObject()
{
object[][] numbers = new object[2][]
{
new object[] {2,"string1", 24.56}, new object[]
{4,"string2", 56.78} };
You may have to attach more attributes to declare the types in the
array... not sure at all if this works.
HTH
Christoph Schittko
MVP XML
http://weblogs.asp.net/cschittko
> -----Original Message-----
> From: john harkin [mailto:jjhnospam@yahoo.co.uk]
[quoted text clipped - 72 lines]
> >
> > --