[Mono-aspnet-list] When a web method returns DataTable the method generated in proxy class returns DataSet (Bug #360541)

Jan van der watt janvanderwatt at gmail.com
Fri Apr 17 01:12:27 EDT 2009


Thanx Gonzalo,

The workaround works.

I say "workaround" because as mentioned before, just dealing with the
DataSet works fine in MS.NET (perhaps they also use DataSet, but allow
and thus infer the usage of a single DataTable?). This quirk is, as
far as I can see, specific to Mono.

Also, I found that if the DataSet name has a space in it, the space is
encoded as "_0x0020_" (probably to ensure safe travel over the web)
and not returned to " " at the client side.

If the DataTable has a space in it, it is returned to the client as a
space (i.e. unchanged).

(see: http://gdbe.webhop.org/test/TestWebServiceDataTable.aspx)

But for me, this is not essential; still, it could snag someone in the future.

Have a good day!

Jan

On Fri, Apr 17, 2009 at 12:11 PM, Gonzalo Paniagua Javier
<gonzalo.mono at gmail.com> wrote:
> On Fri, 2009-04-17 at 10:24 +1000, Jan van der watt wrote:
>> Hi,
>>
>> I added a <%@ Assembly name="System.Data" %> to
>> [TestWebServiceDataTable.aspx] but the effect is still the same.
>>
>> If you inspect the proxy file generate by running the web service
>> (http://gdbe.webhop.org/ws/WebServiceDataTable.asmx?page=proxy),
>> you'll see (towards the end) that DataSet is (still) used, instead of
>> DataTable.
>>
>> (and while at the page, do you know why, when you go to the Test Form
>> for the method, and Invoke it, you get "500 - OK Method HelloWorld not
>> defined in service WebServiceDataTable" - this happens for all
>> methods)
>>
>> Any other suggestions?
>
> Ah! You get the exact same problem running under MS runtime. The
> solution is to do something like:
>
>                DataSet ds;
>                bool success = ws.HelloWorld(out ds);
>                DataTable table = ds.Tables[0];
>
> And that will give you your table.
>
> -Gonzalo
>
>
> _______________________________________________
> Mono-aspnet-list mailing list
> Mono-aspnet-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-aspnet-list
>


More information about the Mono-aspnet-list mailing list