Steve L
10/1/2004 1:28:00 AM
How are you hosting these servers?
Are they console or IIS-based or services? IIS-based will only use HTTP.
Also, are the sinks/sinkproviders listed below custom sinks? In which
case, one might need to review the code there
aniketpalkar@hotmail.com (AP) wrote in
news:fa0c6936.0409300718.176c221b@posting.google.com:
> Hello,
> I am facing a problem with .net remoting. I have one client that
> needs to call two servers.
> Server 1:- Publishes a server activated object with a http channel
> and uses a binary formatter.
> Server 2:- Publishes a server activated object with a http channel
> and uses a soap formatter.
> When I register two channels for contacting these two on client side
> that part works fine. However I am not able to make calls on these two
> servers. Activator.GetObject goes through correctly. However only the
> call to the server which uses the formatter corresponding to the first
> channel registered goes through, the other call fails with a
> serialization error.
>
> code is similar to
>
> HttpChannel httpChnl1 = new HttpChannel(props,
> binaryClientSinkProvider, binaryServerSinkProvider);
>
> HttpChannel httpChnl2 = new HttpChannel(props, soapClientSinkProvider,
> soapServerSinkProvider);
>
> ChannelServices.RegisterChannel(httpChnl1);
> ChannelServices.RegisterChannel(httpChnl2);
>
> IMyInterface obj1 =
> (IMyInterface)Activator.GetObject(typeof(IMyInterface ),
> BinaryServer1Url);
>
> obj1.Call(1); // goes through fine.
>
> IMyInterface obj2 =
> (IMyInterface)Activator.GetObject(typeof(IMyInterface ),
> soapServer2Url);
>
> obj2.Call(2); // fails with a serialization error. From the error it
> seems like it is sending this as binary serialized data, while the
> server is listening with soap.
>
> If I make the second server tcp/soap instead of http/soap it works
> fine. However if I make the first server tcp/binary as well again I
> get the same problem.
>
> How do I make call succesfully on these two servers? I can't control
> what protocol or formatter the server will support. I must make a call
> on them irrespective from my client.
>
> Regards,
> AP
>