每个问题 35分, 单位断网, 明天(星期六)结贴,分不够另外新建帖子送分
cimu 2007-03-23 07:25:53 1 “System.Runtime.Remoting.Channels.ChannelServices.RegisterChannel(System.Runtime.Remoting.Channels.IChannel)”
已过时:“Use System.Runtime.Remoting.ChannelServices.RegisterChannel(IChannel chnl, bool ensureSecurity) instead.”
D:\MY_PROJECT\C#2005_PRJ\ObjectServer\RegeditClass\Program.cs 26 13 RegeditClass
2、由于安全限制,无法访问类型 System.Runtime.Remoting.ObjRef。
未处理SerializationException
3、指定的 SOAPAction 无效: "http://schemas.microsoft.com/clr/nsassem/ObjectServer.ISpatialDataManager/VPFTool#sub"
未处理RemotingException
客户端代码:
ChannelServices.RegisterChannel(new HttpChannel());
string uri = "http://192.168.137.1:8828/GisClassLibary/SpatialDataManager";
ObjectServer.ISpatialDataManager obj = null;
obj = (ObjectServer.ISpatialDataManager)Activator.GetObject(typeof(ObjectServer.ISpatialDataManager), uri);
obj.loadMap1(ref axMapControl); // 调用该方法产生以上问题2
//obj.loadMap2();
MessageBox.Show(obj.sub(1, 2).ToString());// 调用该方法产生以上问题3
编译服务器端的宿主程序,产生告警: 问题1
宿主程序代码:
RemotingConfiguration.ApplicationName = "GisClassLibary";
WellKnownServiceTypeEntry SpatialDataManager = new WellKnownServiceTypeEntry(typeof(ObjectServer.SpatialDataManager), "ObjectServer", WellKnownObjectMode.Singleton);
RemotingConfiguration.RegisterWellKnownServiceType(SpatialDataManager);
ChannelServices.RegisterChannel(new HttpChannel(8828));
ChannelServices.RegisterChannel(new TcpChannel(8829));
Console.ReadLine();