I've got a .Net client app calling my .Net web service which in turn calls a third party web service e.g. at 'www.foo.com'.
.NET Client -> 'My Web Service' -> 'Third Party Web Service'
From VS2008, this all works fine i.e. I'm running 'My Web Service' in localhost:someport which successfully calls the 'Third Party Web Service'.
I then published 'My Web Service' onto a Windows 2003 server.
Now when 'My Web Service' calls the 'Third Party Web Service' I get the exception,
"System.Net.WebException: The remote name could not be resolved: 'www.foo.com'."
I've tried the following:
On the server where I deployed 'My Web Service', I opened IE and entered the web service address 'http://www.foo.com/somewebservice.asmx'. This was successful as the list of available web service methods were displayed.
In the web.config file of 'My Web Service', I changed the 'Third Party Web Service' URL from the web site's name to it's IP address. This failed with the exception, "System.Net.Sockets.SocketException: A socket operation was attempted to an unreachable network".
I then wrote a simple win forms test harness to just call the 'Third Party Web Service'. I ran this test harness on the server and it called the 'Third Party Web Service' successfully.
I then tried a different third party web service which gave the same behaviour as in 1, 2 and 3 above.
Finally I added the IP address to the "hosts" file on the server but got the same "The remote name could not be resolved" error albeit far quicker this time! If it was a DNS issue then I wouldn't expect my tests 1 and 3 to work.
I'd really appreciate any other suggestions as to what I could try.
Thanks.