I have a Visual Studio application which makes heavy use of WCF services. Normally, the team can just download the app from SVN and run and it uses proxy settings from IE and everything is fine.
A new member of the team has just tried to do the same and as soon as the code tries to connect a service client the message similar to below is shown
There was no endpoint listening at http://servername/Service.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. ---> 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 *10.1.2.252:8080*
It is interesting that 10.1.2.252:8080 should be mentioned as I can find no mention of that in either IE proxy settings or netsh so I have no idea where it is originating from.
I can bypass the problem by adding useDefaultWebProxy="false" to the bindings but as no other users get this I want to get to the bottom of this.
Does anyone have any suggestions on where the incorrect proxy address may be originating from - (it is not in any files in the solution as I have searched for it)?
Related
I have had an integration problem when hosting my web application in production, and an unanswered support ticket with SendGrid that was created 5 days prior (at the time of writing this). 1&1 have assured me that all ports are open.
My SendGrid Email API (v3) is working perfectly well in development and when I deploy to a site on my network - I have been using an implementation similar to this: https://app.sendgrid.com/guide/integrate/langs/csharp.
When I deploy to my 1&1 Ionos webspace and test I receive the following error:
System.Net.Http.HttpRequestException: 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.
---> System.Net.Sockets.SocketException (10060): 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.
at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
I am starting to despair as this has caused something of a road block on a project of mine.
[EDIT]
I have just tried a httprequest using a different API and I get the same error. So it must be a server problem with 1&1, but what do I tell them?
I proved the problem was with 1&1, not SendGrid, by testing with another API and getting the same error.
Turns out 1&1 hosting uses a proxy server and I need to amend my SendGrid integration to use a web proxy.
I discovered this:
http://tutorials.moedesign.de/blog/proxy-on-ionos-11-webhosting/
which led me to this help provided by 1&1:
https://www.ionos.co.uk/help/hosting/net/script-examples-for-establishing-external-http-connections-windows/
Quite why they couldn't inform me of this when I rang for support is beyond me.
I have created a very simple web API in C# and there is only one Get method. It's working fine from Visual Studio and IIS. But when I was trying to call it from client machine I was getting error XXX took too long to respond. Search google for XXX 8081 webAPI Get ERR_CONNECTION_TIMED_OUT. I have enabled CORS, increased time out and tried several other steps from StackOverflow. When I checked with fiddler I got below error: [Fiddler] The connection to 'xxx.xxx.com' failed. Error: TimedOut (0x274c). 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 xxx.209.10.72:8081.
I found out that I need to open a 8081 port from windows firewall on the server. I opened inbound rule for port 8081 and it resolved the issue. After that I was able to make webapi call from any client machine.
I have HttpWebRequest and its giving this error.I cannot try this answer because i cannot use local ip.There is a strange issue that in my computer there is no error like this but in the server its giving this error.The database is not in server we are using an api for crud operations.By the way the project is windows service. Its giving this error and then the service is stopping.there is another detail.The server where i install the windows service (its is not a server that has th database.) has %100 cpu usage and almost %100 ram usage.I set the timetout of request 100 seconds but it is not solve the problem.The detailed answer as below
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....
How can i solve this ? And idea? By the way about 50 seconds program trying to post request and then giving the error.Also there is another detail the database owner api has get methods that lists some data i can open them from browser with same link that i used in post
The Problem is about proxy settings of httpwebrequest. Setting a proxy solved this.
Created .net custom tcp server and client using tcplistener. Taks is simple to exchange the data. I have Windows server, on which I am able to communicate. Within network also I am able to communicate. When I deploy this same on our web server, public IP is not accepting connections. At client side it throws time out error:
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 .....
Trace route shows request is going there till server and at the end its not showing time out. Server is VM on azure.
Add the endpoint to the Azure configuration:
https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-set-up-endpoints/
Thanks for your help. It was firewall issue. It is resolved but I am clueless about the problem. Firewall ports opened earlier did not worked. so I stopped firewall and I found its working. later on I started and firewall it again worked. strange....fire wall is not updated it seems.
Thanks.
Kishor
I have created WCF netpipe connection on "net.pipe://localhost/IBS" which has an endpoint listening at "BasicService".
Creating this and hosting within my app is fine. But when I try to connect to this through "net.pipe://localhost/IBS/BasicService" this connection fails.
It throws exception like following.
There was no endpoint listening at **net.pipe://localhost/IBS/BasicService** that could accept the message.
This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
While digging into this, I found that this connection failure happens only when the hosting app is running in non-admin mode. If I switch to admin mode the connection succeeds.
The issue happens because some other pipe is open on net.pipe://localhost in admin mode. So while my client tries to communicate to net.pipe://localhost/IBS/BasicService it ends up searching in net.pipe://localhost for IBS/BasicService. Where as i wanted it to search in net.pipe://localhost/IBS for BasicService.
Services running in admin mode is taking precedence. Is there a way in WCF to configure it other way or at-least after not finding at localhost it should try finding in localhost/IBS also.
Thanks.