不清楚要解决的问题,请看这里:
http://www.cnblogs.com/weko/archive/2004/12/20/79632.html#FeedBack
问题主要出在客户端,具体如下:
1.定义正确的http通道后
HttpChannel channel = new HttpChannel();
ChannelServices.RegisterChannel(channel);
channel = (HttpChannel)ChannelServices.GetChannel("http");
2.加入下面的话句
WebProxy wp = GlobalProxySelection.Select as WebProxy; //获取机器默认的proxy服务器变量
wp.Credentials = CredentialCache.DefaultCredentials; //将机器上默认的信任传入刚才指定的proxy服务器变量
SetChannelProxy(channel,wp); //将上面建好的proxy服务器变量传入到已定义的channel中
private static void SetChannelProxy( HttpChannel channel, IWebProxy proxy ) {
FieldInfo clientChannelFieldInfo = typeof(HttpChannel).GetField("_clientChannel",BindingFlags.Instance | BindingFlags.NonPublic);
HttpClientChannel clientChannel = (HttpClientChannel)clientChannelFieldInfo.GetValue(channel);
FieldInfo proxyObjectFieldInfo = typeof(HttpClientChannel).GetField("_proxyObject",BindingFlags.Instance | BindingFlags.NonPublic);
proxyObjectFieldInfo.SetValue( clientChannel, proxy );
}
3.再建立连接通道
FI_RecordingsManager = (IRecordingsManager) Activator.GetObject(typeof(IRecordingsManager),"http://"+CPSERVERIP+":"+CPSERVERPORT_HTTP.ToString()+"/RM");
浙公网安备 33010602011771号