Wcf – disable web proxy for a WCF client

.net-4.0PROXYwcf

My computer have a proxy server defined globally (in internet options configuration).

I have a .Net 4 application that use a WCF client to a remote host. The client code has been generated by VS add service reference dialog. As my proxy can't reach the host, each call ends with a communication exception.

How can I set up my client configuration to not use the default proxy ?

Best Answer

You can tell WCF not to use the default proxy by setting the BasicHttpBinding.UseDefaultWebProxy to false:

<client>
    <endpoint address="http://server/myservice"
              binding="basicHttpBinding"
              contract="IMyService" />
</client>
<bindings>
    <basicHttpBinding>
        <binding useDefaultWebProxy="false" />
    </basicHttpBinding>
</bindings>