我可以在远程使用的界面中航油?中航油、界面

2023-09-03 23:32:12 作者:对你微笑只因礼貌

在中航油没有URI,所以指定类型,必须在服务器端注册。但是,如果我的客户端和服务器通过相同的界面交互(远程对象实现了接口),那么我怎么能叫曹远程对象的客户端。它给了我的异常,如果我尝试使用的接口类型来调用Acitvator.CreateInstance。 对于例如。

In CAO there is no URI, so specified type has to be registered on the server side. But if my client and server interact through the same interface (remote object implements interface) then how can I call CAO remote object from client side. It gives me exception if I try to call Acitvator.CreateInstance using interface type. for e.g.

RemoteObject.IRemoteObject obj = (RemoteObject.IRemoteObject )Activator.CreateInstance(typeof(RemoteObject.IRemoteObject), null, url);

以上code抛出异常。

above code throws exception.

推荐答案

您可能需要考虑使用这个MSDN文章的实施经纪人与.NET Remoting的使用客户端激活的对象。该模式使用一个SAO工厂来创建集体劳动协议。

You might want to consider using the technique outlined in this MSDN article Implementing Broker with .NET Remoting Using Client-Activated Objects. This pattern uses a SAO factory to create CAOs.

我用在工作中这种技术,它工作得很好。

I've used this technique on the job and it works well.

 
精彩推荐