I am writing a webservice using .Net 3.5.
My webservice consumes an external WCF, to get to it I have to pass through our proxy server that requires authentication.
To do that I use this code:
WebProxy wproxy = new WebProxy(ProxyServer, Port);
wproxy.Credentials = new NetworkCredential(ProxyUser, ProxyPassword, Domain);
WebRequest.DefaultWebProxy = wproxy;
The server I need to run my webservice on is a IIS 7.5 webserver (Windows Server 2008 R2 standard), when I run it there I get the following message (this is the response from the external WCF) :
The remote server returned an unexpected response: (407) authenticationrequired
For testing I also tried to run it on a older server using IIS 6 (Windows Server 2003 R2 standard) and on this server it worked fine.
So anyone have an idea whats going on here?
I managed to solved this problem by installing .NET 4 on the IIS server, the server that had the IIS 6 already had .NET 4 installed.
I still don’t know why this happend since my program is using .NET 3.5.
Could possbly be that .NET 4 fixes something in the base files of .NET or changes some defualt behaviour.