zoukankan      html  css  js  c++  java
  • Remoting中的配置

    配置Remoting共有如下二个方面 ,一个是服务端配置,一个是客户端配置
    服务端配置如何(宿主为IIS)
    <system.runtime.remoting>
      <application>
       <service>
        <wellknown mode="Singleton" type="ComPlusLibrary.Test,ComPlusLibrary" objectUri="ServerSide.rem" >
        </wellknown>
            <wellknown mode="Singleton" type="JobServerLib.JobServerImpl,JobServerLib" objectUri="JobServer.rem" />
            <channels>
              <channel ref="http" useDefaultCredentials="true" />
            </channels>
          </service>
      </application>
     </system.runtime.remoting>

    在配置完服务器之后,我们可以通过这样的方式,看看我们有没有配置正确
     
    http://itc006/TestRemoting/ServerSide.rem?wsdl如果出来一个XML文档,那就说明配置对了。

    注意:在wellknown中的Type是类全名,Assembly的名(不需要DLL)
    二是客户端配置
     <system.runtime.remoting>
        <application>
          <client>
            <wellknown url="http://itc006/TestRemoting/ServerSide.rem" type="ComPlusLibrary.Test,ComPlusLibrary">
            </wellknown>
            </client>
        </application>
       
      </system.runtime.remoting>
     
    最后在客户端使用:
                System.Runtime.Remoting.RemotingConfiguration.Configure("client.exe.config");
    先注册一下。

    Test test = new ComPlusLibrary.Test();
                ICustomer cusomer = test.GetCustomer();
                cusomer.Name = "testing..";
                MessageBox.Show(cusomer.Name);
     
    基本上就是这样,现在还有两个问题需要解决:
    一个是自定义REMOTING的头信息,二是通过二进制的形式传递数据。
     
     
     
  • 相关阅读:
    常用资源
    printf打印颜色
    Vue开发中踩坑-Day3
    Vue开发踩坑-Day2
    Vue开发中的踩坑-day1
    Python中virtualenv的使用
    第十一章:Python高级编程-协程和异步IO
    第十章:Python高级编程-多线程、多进程和线程池编程
    第九章:Python高级编程-Python socket编程
    自定义Element父子不关联的穿梭树
  • 原文地址:https://www.cnblogs.com/DaiWei/p/344501.html
Copyright © 2011-2022 走看看