Sunday, June 6, 2010

WCF: HTTP 407 Proxy Authentication Required

This error is really a big hassle for my web service program in our company. Our company use proxy and my program cannot go through if the proxy setting is being checked on the client PC. It took me quite awhile to research on how to resolve this issue until I come across this lovely article.. This really resolves the issue.

http://www.mikebevers.be/blog/2009/06/wcf-http-407-proxy-authentication-required/

I just simply need to add this in my app.config file

<system.net>
<defaultProxy useDefaultCredentials="true">
</system.net>

And as for WCF configuration we can keep the two attritubes

bypassProxyOnLocal="false"
useDefaultWebProxy="true"

if we want to enforce proxy on the web service

If we want to bypass proxy then we have to change it to

bypassProxyOnLocal="true"
useDefaultWebProxy="false"


And the solution will simply works like a charm. ;)