System.MarshalByRefObject cannot be converted into parameter type Interfaces.IClientSessie e
Hello
I'm having a problem in my remoting application (client part). This is the exception I get "The argument type System.MarshalByRefObject cannot be converted into parameter type Interfaces.IClientSessie."
The exception happens on balie.login(...
banksessie1.ClientSessieseems to be the problem removing this part solves the exception. I can't seem to find the problem. Anyone any insights or at least some more information about this error?
(part of) Button click
try
{
int nummertje;
string text;
BankSessie banksessie1 =newBankSessie(this.balie);
string text2 =this.balie.logIn(this.textBoxNaam.Text,this.textBoxWachtwoord.Text,banksessie1.ClientSessie,out nummertje,out text);
if (text2 !=null)
{
banksessie1.Nr = nummertje;
banksessie1.Naam = text;
banksessie1.Sessie = text2;
banksessie1.stopped +=newBankSessieStopped(this.bs_stopped);
base.Hide();
banksessie1.Show();
}
else
{
this.richTextBoxMededeling.Text ="Inloggen is mislukt";
}
}
catch ()
{
this.richTextBoxMededeling.Text ="Connectie niet in orde\nProbeer opnieuw verbinding te maken";
}
-
publicinterfaceIBalie
{
// Methods
string logIn(string accountnaam,string wachtwoord,IClientSessie saldoUpdate,outint nr,outstring naam_plaats);
void logUit(string sessieId,IClientSessie saldoUpdate);
bool maakOver(string sessieId,int bron,int bestemming,Money bedrag);
string openRekening(string naam,string plaats,string wachtwoord);
bool valid();
}
publicclassIClientSessie :MarshalByRefObject
{
// Methods
publicoverrideobject InitializeLifetimeService()
{
returnnull;
}
[OneWay]
publicvirtualvoid RekeningSaldoChanged(int rekening,string saldo)
{
}
}
-
privateclassClientSessieListner :IClientSessie
{
// Methods
public ClientSessieListner(BankSessie sessie)
{
this.sessie = sessie;
}
publicoverridevoid RekeningSaldoChanged(int rekening,string saldo)
{
this.sessie.SaldoUpdate(rekening, saldo);
}
// Fields
privateBankSessie sessie;
}
This is everything I think that’s has some relevance to the problem, if you need anymore please let me know.
Mark Bosch

