设置useDefaultWebProxy =在WCF客户端的错误与Web-引用 [英] Set useDefaultWebProxy=false on WCF Client with the Web-References

查看:149
本文介绍了设置useDefaultWebProxy =在WCF客户端的错误与Web-引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有添加的Web-引用一个WCF服务的Windows窗体应用程序。我需要WCF客户端上设置属性useDefaultWebProxy为假。

I have a Windows-Forms application with added Web-References to a WCF Service. I need to set on the wcf client the property "useDefaultWebProxy" to "false".

如果我已经添加了服务参考,而不是网络参考,我可以很容易地修改app.config文件:

If I had added the "Service-References", instead of the "Web-References", I could easily modify the app.config file:

<basicHttpBinding> 
  <binding name="pluto" ... useDefaultWebProxy="false"> 
   <readerQuotas ... /> 
   <security ...> 
    <transport ... /> 
    <message ... /> 
   </security> 
  </binding> 
 </basicHttpBinding> 

不过,我在Web引用,我该怎么办?
谢谢,
Pileggi

But I have the Web-References, how can I do? Thanks, Pileggi

推荐答案

好吧,一个解决方案:

System.Net.WebRequest.DefaultWebProxy = MyWebClient.Proxy;
MyWebClient.MyFirstCall(username, password);

Pileggi

Pileggi

这篇关于设置useDefaultWebProxy =在WCF客户端的错误与Web-引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆