问题描述:
1 服务端 A 和 服务端 B 都通过 配置文件  的方式 发布了远程对象X
2 客户端C刚开始通过 配置文件 的方式访问了A上的X,后来需要通过 程序的方式 访问B中的X。
问题
现在出现的问题如下:
  The server committed a protocol violation. Section=ResponseStatusLine附录部分代码服务端A的配置文件:

<service>
<wellknown mode="Singleton" type="RemoteObjLib.SysConfig, 
                             RemoteObjLib" objectUri="Remote2" />
</service>
<channels>
            <channel ref="tcp" port="6791" displayName="tcp channel ">
              <serverProviders>
                <provider ref="binary" typeFilterLevel="Full" />
              </serverProviders>
            </channel>
</channels>

服务端B的配置文件同上 只是改动了一下端口为6792(和问题无关,改不改抛出的错误都一样)客户端C的配置文件

      <client>        <wellknown type="RemoteObjLib.SysConfig,        RemoteObjLib" url="tcp://localhost:6791/Remote2" />
 </client>
      <channels>
        <channel ref="tcp" port="0">
          <serverProviders>
            <provider ref="binary" typeFilterLevel="Full" />
          </serverProviders>
        </channel>
      </channels>
在C中,访问A中的Sysconfig是正常的然后需要访问B中的Sysconfig:
  channalTcp = new TcpClientChannel("B_TCP", new BinaryClientFormatterSinkProvider());
ChannelServices.RegisterChannel(channalTcp);
SysConfig TagAttrOperColl = (SysConfig)Activator.GetObject(
                typeof(SysConfig),
                "http://  10.10.3.231 :6792/Remote2");
这个时候生产的代理不为空
但是真正访问的时候就抛出上述错误:
  The server committed a protocol violation. Section=ResponseStatusLine

解决方案 »

  1.   

    没碰到过 帮你搜了个链接 
    http://rushing.bokee.com/5109452.html
    希望有帮助
      

  2.   

    然后需要访问B中的Sysconfig:
      channalTcp = new TcpClientChannel("B_TCP", new BinaryClientFormatterSinkProvider());
    ChannelServices.RegisterChannel(channalTcp);
    SysConfig TagAttrOperColl = (SysConfig)Activator.GetObject(
                    typeof(SysConfig),
                    "http://  10.10.3.231 :6792/Remote2"); 
    错误在这里
    服务端是注册的tcp信道
    客户端通过http去访问
    呵呵
    低级错误