110,569
社区成员
发帖
与我相关
我的任务
分享
string host = "localhost";
int port = 1177;
// 建立并注册IIOP通道,与服务器corba进行通信
IiopClientChannel channel = new IiopClientChannel();
ChannelServices.RegisterChannel(channel,false);
//本地corba初始化
CorbaInit init = CorbaInit.GetInit();
NamingContext nameService = init.GetNameService(host, port);
//根据对象绑定的服务名获取远程对象
NameComponent[] nameMz = new NameComponent[] { new NameComponent("test", "") };
intTest mz = (intTest)nameService.resolve(nameMz);--到这里就提示异常了
Console.WriteLine();
}
catch (Exception ex)
{
Console.WriteLine("exception: " + ex);
}