Transfering objects

We are just evaluating remobjects sdk to transfer objects from Windows Compact Embedded 7 as a Server to a Windows PC client, means e.g. I would like to implement List getpersons, instead of sending just e.g an array of strings. Is that possible with remobjects SDK?

Hello Wolfgang.

Yes, it is possible to implement, for example, List object and send it to the client. You can serialize List object to Binary on the server side, send it to the client, and then deserialize Binary object to List on the client side. Please take a look at the archive I have sent you by email.

Server contains an operation that returns Dataset as Binary:

        public Binary GetDataset()
        {
            DataSet lDataset = new DataSet("RemoteData");

            DataTable lTable = new DataTable("SampleTable");
            lTable.Columns.Add("Column1", typeof(Int32));
            lTable.Columns.Add("Column2", typeof(String));

            lTable.Rows.Add(new Object[] { 42, "The Answer" });
            lTable.Rows.Add(new Object[] { 256, "This is 2^8" });

            lDataset.Tables.Add(lTable);

            Binary lResult = new Binary();
            lDataset.WriteXml(lResult, XmlWriteMode.WriteSchema);

            return lResult;
        }

Client deserializes Binary to Dataset:

        private void GetDataButton_Click(object sender, EventArgs e)
        {
            ClientChannel lClientChannel = new IpHttpClientChannel() { TargetUrl = @"http://127.0.0.1:8098/bin" };

            BasicLibrary.Namespace.IBasicService lService = BasicLibrary.Namespace.CoBasicService.Create(new BinMessage(), lClientChannel);

            Binary lSerializedDataSet = lService.GetDataset();

            DataSet lDataSet = new DataSet();

            lDataSet.ReadXml(lSerializedDataSet, XmlReadMode.ReadSchema);

            MessageBox.Show(String.Format("Dataset Retireved\nFirst Table has {0} row(s)\n1st row contains {1}, '{2}'\n2nd row contains {3}, '{4}'",
                lDataSet.Tables[0].Rows.Count,
                lDataSet.Tables[0].Rows[0][0], lDataSet.Tables[0].Rows[0][1],
                lDataSet.Tables[0].Rows[1][0], lDataSet.Tables[0].Rows[1][1]));
        }

Thanks