"Unable to connect to the remote server"

I can call a third-party web service from a Windows forms program just fine. When I try to call the same web service and web method and the same URL from the WCF web service, I get the following error:

ExportValuationPolicyNumber:Exception=System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: 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 66.77.241.76:80 at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) --- End of inner exception stack trace --- at System.Net.HttpWebRequest.GetRequestStream() at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at TFBIC.RCT.WCFWebServices.ExpressLync.ValuationServiceWse.ExportValuationPolicyNumber(String PolicyNumber) in c:\Source\TFBIC.RCT.WCFWebServices\TFBIC.RCT.WCFWebServices\Web References\ExpressLync\Reference.cs:line 519 at TFBIC.RCT.WCFWebServices.ValuationService.ExportValuationPolicyNumber(String PolicyNumber) in c:\Source\TFBIC.RCT.WCFWebServices\TFBIC.RCT.WCFWebServices\ValuationService.svc.cs:line 97 

I am basically trying to write a WCF wrapper for a .asmx / WSE3 provider. Let it not go away, but Microsoft says that WCF can call WSE3, but only with SSL enabled, and my provider - believe it or not - does not allow SSL connections. So I started writing a wrapper so that I could call from BizTalk 2009. Now I'm testing the shell through a console program.

What can I do for debugging? I added EventLog traces before and after the WCF service, where it calls the .asmx service, so I know where it blows (plus the line number in the above error).

In my web.config there is the following:

 <microsoft.web.services3> <diagnostics> <trace enabled="true" input="c:\inetpub\wwwroot\wsetraces\InputTrace.webinfo" output="c:\inetpub\wwwroot\wsetraces\OutputTrace.webinfo" /> <detailedErrors enabled="true" /> </diagnostics> </microsoft.web.services3> 

and I gave the directory full access to everyone, but no traces appear.

What are some things I can find, or try debugging this again?

In theory, ping results should not matter because the website is running a Windows form program that calls it just great.

Nonetheless, this is what Ping shows, and it looks a bit dubious to me:

C: \ Users \ uxnxw01> ping rct.msbexpress.net

 Pinging rct.msbexpress.net [66.77.241.56] with 32 bytes of data: Reply from 10.193.99.5: Destination net unreachable. Reply from 10.193.99.5: Destination net unreachable. Request timed out. Reply from 10.193.99.5: Destination net unreachable. Ping statistics for 66.77.241.56: Packets: Sent = 4, Received = 3, Lost = 1 (25% loss), 

Thanks,

Neal Walters


WireShark Analysis

I launched Wireshark - in the comments were some results. However, after reading it more, he does not always say "Destination Unreachable". But in case it doesn't work, I never get any database. I am still confused what to do next. I was comparing packages, but it was slow and confusing. For example, I still have not found the key (specific policyNum) that I pass in the request packet. I also see several expressions of “Unavailable destinations” in what worked.

In what works, I never see 66.77.241.76, I only see the proxy server of our company. But I do not see anything in the config (or code) that would tell WSE3 to use or not use a proxy.


Telnet Results:
 C:\Users\uxnxw01>telnet 66.77.241.56 80 Connecting To 66.77.241.56...Could not open connection to the host, on port 80: Connect failed C:\Users\uxnxw01>telnet 66.77.241.76 80 Connecting To 66.77.241.76...Could not open connection to the host, on port 80: Connect failed 

I am not sure what this proves. As I said, I can definitely call the same web service from a Windows form by directly calling its WSE3 interface. I know that I can get there.

I think that the main differences in the two programs are that it works under the Win-form and directly calls WSE3. It works. The one that fails basically makes up 99% of the same code that is published as a WCF service, so it runs on IIS (then the console program calls the WCF / IIS service on my machine, which in turn calls the WSE3 service).

Is there any reason IIS will not use the same proxy?

+4
source share
4 answers

Thanks to all the help above - but here is the real answer:

valservice.Proxy = new System.Net.WebProxy (" http: //10.192.xx.xx: 8080 ", true);

The WCF service running under IIS did not seem to use the same proxy server, so I installed it manually in the code. I will write another question to find out if there is a way to do this in the configuration file.

+3
source

Ping requests (ICMP packets) can be disabled on the firewall. Thus, it is quite possible not to get the ping response back, having access to the mailbox on different ports.

Try using telnet to connect to 66.77.241.56 on port 80 and see if you get the answer.

telnet 66.77.241.56 80

Alternatively, tracerte to the specified IP address may provide more detailed information for one of your network administrators, as this may also be related to network routing or NAT.

A third possibility is that you may need to explicitly specify the Proxy property on your SoapHttpClientProtocol SOAP client SoapHttpClientProtocol . WinForms selects this automatically, but from a web service / application it is not.

+2
source

You can use Wireshark to find out what happens to network traffic.

+2
source

See my comments on other people's posts, too, but also related to your diagnostic log, this is the XML that I have in my configuration to reset the WCF trace log:

 <configuration> <system.diagnostics> <sources> <source name="System.ServiceModel" switchValue="Information, ActivityTracing" propagateActivity="true"> <listeners> <add name="traceListener" type="System.Diagnostics.XmlWriterTraceListener" initializeData= "MyService.svclog" /> </listeners> </source> </sources> </system.diagnostics> </configuration> 
0
source

All Articles