Hello,
I'm trying to use remoting under IIS for the first time to send a collection from the server to the client, but I'm doing something wrong I guess.
For testing I'm trying to do it with selfservicing, I know I shoud do it with adapter.
This is the service code:
public MemoryStream Getcustomerlist()
{
Sean.Dal.HelperClasses.DbUtils.ActualConnectionString = @"Database=C:\Temp\POLISAGENT.FDB;DataSource=127.0.0.1;User=SYSDBA;Password=masterkey; Port=3050;Role=;CharSet=ISO8859_1";
Sean.Dal.CollectionClasses.AgentenCollection agenten = new AgentenCollection();
agenten.GetMulti(null);
BinaryFormatter b = new BinaryFormatter(); // create the formatter
MemoryStream s = new MemoryStream();
b.Serialize(s, agenten);
return s;
}
This is the client code:
private void simpleButton1_Click(object sender, EventArgs e)
{
string CLIENT_URL = "http://localhost/IISRemotingHosting/Customer.rem";
RemotingConfiguration.RegisterWellKnownClientType(typeof(Customer), CLIENT_URL);
Sean.Dal.CollectionClasses.AgentenCollection agentenlist = new AgentenCollection();
AcBusinessObjects.Customer cust = new Customer();
//Sean.Dal.CollectionClasses.AgentenCollection agenten;
MemoryStream agenten = cust.Getcustomerlist();
BinaryFormatter b = new BinaryFormatter();
agentenlist = (AgentenCollection)b.Deserialize(agenten);
}
When I'm running this, I get the following error: End of Stream encountered before parsing was completed.
When I try without the binaryformatter I get:
Soap Serializer does not support serializing Generic Types : System.Collections.Generic.Dictionary2[System.Guid,System.Collections.Generic.Dictionary
2[ System.String,SD.LLBLGen.Pro.ORMSupportClasses.EntitySyncInfo`1[SD.LLBLGen.Pro.ORMSupportClasses.IEntity]]].