Remoting: Returning an Arraylist of datatables

Z

Z D

Hello,

I'm currently using Remoting (HTTP/Binary) to remote a simple object.
Everything is working fine except for one function that returns an arraylist
of datatables.

When I call this function, nothing is returned (ie length of array =0).
However, if I comment out my config file so that the DLL is run locally
instead of remoting it, everything works fine!!

So, my question is: Is there anything special that I need to do in order to
return an arraylist of datatables? Note: If I return a single datatable it
works fine, just the arraylist of dt's dont seem to work via remoting.....

Thanks in advance,
-ZD
 
S

Sunny

Hello,

I'm currently using Remoting (HTTP/Binary) to remote a simple object.
Everything is working fine except for one function that returns an arraylist
of datatables.

When I call this function, nothing is returned (ie length of array =0).
However, if I comment out my config file so that the DLL is run locally
instead of remoting it, everything works fine!!

So, my question is: Is there anything special that I need to do in order to
return an arraylist of datatables? Note: If I return a single datatable it
works fine, just the arraylist of dt's dont seem to work via remoting.....

Thanks in advance,
-ZD

Hi,
and what happens if you return an ArrayList, which contains some strings
only?

I this works, that as far as I remember there was some problems with
datatables/datasets with remoting. What you can do is to create a
dataset, which holds all these tables. The you export this dataset in
XML string and pass this string over remoting. You are not going to
loose any performance, as datasets are always serialized to XML, even
with binary formatter. Then on the client side you can recreate the
dataset from the string and access the tables. Nor very elegant
solution, but it should work.

If passing the arraylist with strings does not work, than most probably
you have some remoting configuration problem.

Also, you may try to capture the appdomain.Resove event and see if
during the serialization/deserialization there is some assembly missing.

Sunny
 
Z

Z D

Sunny,

Thank's for your reply.

The problem was that my remoted object was exposing an arraylist as a
property. Apparently doing: RemoteObj.ArrayListProperty.Add(something)
doesn't seem to work. So instead, I've had to replace the property with a
method that accepts an arraylist as a parameter and then I set my internal
arraylist variable equal to the param. that was passed in. Now things seem
to work fine.

Any idea why that doesnt work?

Thanks
-ZD
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top