Can't access web service when connected to the network :: HTTP 407
I have a console application that communicates with a web service. Both of them are on the same machine.
When I am accessing the web service with the LAN disabled, it connects without a problem. But if the LAN is enabled and connected to our office network, I receive this error:
"HTTP 407 Proxy Authentication required - The ISA Server requires authorization to fulfill the request. Access to the We开发者_StackOverflowb Proxy service is denied."
We've been hunting the source of the problem for three days now. We have tried everything that we can think of. Any ideas what's causing the problem?
Additional notes: - The machine is in a Workgroup setup but with DNS suffix (computer.local). When accessing the web service, we type the address as "http://machine.computer.local/service.asmx"
I talked to the IT guys and they said that we don't have an ISA server installed
There is no "proxy" set in IE.
The machine is in mint condition.
Apparently, the IT guys that I've talked with is not aware of the corporate-wide ISA server.
Using Wireshark, I dumped the data to an HTML file (a standard HTTP 407 error page). It clearly showed the Hostname and IP address of the ISA server.
In short, the problem is the ISA server. Although it is still a mystery on why the machine would contact the ISA server if the IIS server hosting the site is located on the machine itself (localhost).
Workaround: Use the bypassonlocal property.
<configuration>
<system.net>
<defaultProxy>
<proxy proxyaddress="<ISA-SERVER>" bypassonlocal="true"/>
</defaultProxy>
</system.net>
</configuration>
Try adding the following line to your hosts file:
127.0.0.1 machine.computer.local
Under "configuration" section in Web.config add this:
<system.net>
<defaultProxy enabled="true" useDefaultCredentials="true"></defaultProxy>
</system.net>
Then works like a charm!
精彩评论