I spent almost 50 hours finding the problem, could not find anywhere on the web this simple solution.
Under "configuration" section in Web.config add this:
<system.net>
<defaultProxy enabled="true" useDefaultCredentials="true"></defaultProxy>
</system.net>
Then works like a charm!
You can also do it from the code behind:
serviceConnection = new WebService1();
serviceConnection.Proxy = System.Net.HttpWebRequest.GetSystemWebProxy();
serviceConnection.Proxy.Credentials = CredentialCache.DefaultCredentials;
Works beautiful!!.
If you need to consume from HTTPS location add this configuration:
<message clientCredentialType="Certificate" algorithmSuite="Default" />
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…