[Mono-dev] 1.2.4 -> 1.2.6 broke remoting?
Jay L. T. Cornwall
jay at jcornwall.me.uk
Thu May 8 17:22:12 EDT 2008
Hi,
I have a simple remoting example that works fine on Ubuntu Gutsy 7.10
(with Mono 1.2.4) but fails on 8.04 (with Mono 1.2.6 and with
source-built 1.9.1). This is the stripped down server:
HttpServerChannel channel = new HttpServerChannel(52938);
ChannelServices.RegisterChannel(channel, false);
RemotingConfiguration.RegisterWellKnownServiceType(typeof(RemoteInterfaceFactory),
"RemoteInterfaceFactory.soap", WellKnownObjectMode.Singleton);
This is the client:
HttpClientChannel channel = new HttpClientChannel();
ChannelServices.RegisterChannel(channel, false);
IRemoteInterfaceFactory factory =
(IRemoteInterfaceFactory)Activator.GetObject(typeof(IRemoteInterfaceFactory),
"http://localhost:52938/RemoteInterfaceFactory.soap");
IRemoteInterface remoteInterface = factory.Create();
The remote interface is shared in a DLL between the client and server:
(In shared .dll)
public interface IRemoteInterfaceFactory {
IRemoteInterface Create();
}
(In server .exe)
public class RemoteInterfaceFactory : MarshalByRefObject,
IRemoteInterfaceFactory {
public IRemoteInterface Create() {
return new RemoteInterface();
}
}
On Mono 1.2.6 and 1.9.1 I receive this exception once the
factory.Create() method is called:
Unhandled Exception:
System.Runtime.Serialization.SerializationException: The object with ID
2 could not be resolved
at System.Runtime.Serialization.ObjectManager.DoFixups () [0x00000]
at
System.Runtime.Serialization.Formatters.Soap.SoapReader.get_TopObject ()
[0x00000]
at
System.Runtime.Serialization.Formatters.Soap.SoapReader.Deserialize
(System.IO.Stream inStream, ISoapMessage soapMessage) [0x00000]
at
System.Runtime.Serialization.Formatters.Soap.SoapFormatter.Deserialize
(System.IO.Stream serializationStream,
System.Runtime.Remoting.Messaging.HeaderHandler handler) [0x00000]
...
However, the complete RPC system works fine on 1.2.4. Has a technique
that I've used been obsoleted?
Thanks,
--
Jay L. T. Cornwall
http://www.jcornwall.me.uk/
More information about the Mono-devel-list
mailing list