问题
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".
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>
But I have the Web-References, how can I do?
回答1:
Ok, a solution:
System.Net.WebRequest.DefaultWebProxy = MyWebClient.Proxy;
MyWebClient.MyFirstCall(username, password);
Pileggi
来源:https://stackoverflow.com/questions/12247129/set-usedefaultwebproxy-false-on-wcf-client-with-the-web-references