views:

658

answers:

4

I am getting the following error when I try to call an ASP.NET Web Service from an ASP.NET Web Application. I believe it is because the Web Service and Web Application are on the same Farm/behind the same Load Balancer.

A connection attempt failed because the connected party did not properly
respond after a period of time, or established connection failed because
connected host has failed to respond [IP Address removed]:80

This error does not occur when I call the Web Service on the Farm from the Web App on my local machine, or when I call the Web Service on my local machine from the Web App on the Farm.

Any idea why this error is occurring?

A: 

This is just a guess, but can the web server actually see the IP address being used? If it's on a farm behind a load balancer then that IP might be being blocked by the load balancer itself or a firewall or proxy server.

Can you access the web server via remote desktop and ping the IP address?

ChrisF
After remoting on to one of the servers in the Farm, which IP Address would you like me to ping? The Address of the Server itself, another Server in the Farm, or the LoadBalancer?
Aaron Hoffman
The public IP address and/or name of the machine running the web service. As I said, it's a guess, but it could be that that machine can't see the public IP for some reason
ChrisF
In fact you could trying pinging any IP address from the box to see if it can see out at all.
ChrisF
A: 

The TCP/IP stack on your farm node is not going to route the call to the IP address of the load balancer, but will automatically translate this into a local call on 127.0.0.1:80 on the specific farm node that is making the call. Make sure your web servers are set up to handle this case.

Peter Stuer
A: 

The solution to my problem was to turn on NATing on the load balancer.

The request was being made from a server in the farm to the Load Balancer, then the Load Balancer would send that request to one of the servers in the farm (possibly even the same server that requested it). The problem was, the server that was handling the request would try to send the response directly back the the "requesting client" instead of back to the Load Balancer, so the server that made the request would just ignore the response because it was not being sent by the Load Balancer. By turning NATing on, all responses are sent back to the Load Balancer, and then the Load Balancer sends the response on to the original client.

Aaron Hoffman
A: 

Hi Aaron,

I've got the same problem. We host our web application and web services application on a shared hosting server. Could you explain to me how to turn on NATing on the load balancer, please?

Thanks in advance.

Xiaosu

Xiaosu
I think it is going to be different for each Server/LB. Just search for your LB and NAT. this may help http://lbwiki.com/index.php/NAT
Aaron Hoffman