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 ?
A client application uses the WCF client proxy to communicate with the service. Client applications usually import a service's metadata to generate WCF client code that can be used to invoke the service. The basic steps for creating a WCF client include the following: Compile the service code.
Actually Proxy is a class in WCF that is used to communicate with client application. We can simply get the entire configuration through the proxy class. There is no need to do extra effort to generate the configuration setting for the client. Proxy class used when you think that your service must be loosely coupled.
The error message 'When using a non-null Proxy, the WindowsProxyUsePolicy property must be set to WindowsProxyUsePolicy. UseCustomProxy. ' is related to a bug. Solution is to update your libs to latest version.
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>
In your Binding configuration, set useDefaultWebProxy=false
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With