I get the following error on my asp.net website, while trying to invoke a wcf service method:
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 77.XXX.XX.XX:809
And then more in detail, I get a socketexception, webexception and also this endpointnotfoundexception:
There was no endpoint listening at
http://77.XXX.XX.XX:809/RemoteSyncService/ that could accept the
message. This is often caused by an incorrect address or SOAP action.
The wcf service (RemoteSyncService) is hosted in a .net application on the 77.XXX.XX.XX server. The binding used is basicHttpBinding.
The endpoint address, used in the asp.net site web.config is:
http://77.XXX.XX.XXX:809/RemoteSyncService
// this is the same on the remote server
The service code for the asp.net website was automatically generated, by using the 'add service reference' feature in VS2010 (on this address: http://77.XXX.XX.XXX:809/RemoteSyncService/mexHttp, as described in the other remote server).
All works perfectly on the dev machine..
What I tried and works:
running/debugging the asp.net locally, and invoking methods
trying to contact the wcf service with wcf test client
the asp.net site can contact the other server, because a ftp transfer from my asp.net site to the remote server was successful
pinging the remote server
Will provide code if needed..
make sure your production server isn't firewalling you.
Related
I have a site published in a IIS Server, but now i am adding a Connected Service using a WCF Soap to access another server.
Basically, my site needs consult a information from another server, and to this he needs to WCF.
When i publish my site in my homolog server, he death, and returne HTTP ERROR 500. However, in a localhost is normal.
I'm using a netcore 2.2
I have a WCF WebService (.NET 4.0) that is accessible through a public IP address. I have a C# MVC project running (.NET 4.7.2) that I host in Azure. I connect to this WCF Service as a Connected Service in my VS2017 project.
When I run the MVC app locally it works fine - I can connect to the service and read the data. However, when I publish to the Azure AppService I get an error:
There was no endpoint listening at
http://12.3.456.78:8080/MyService.svc that could accept the
message. This is often caused by an incorrect address or SOAP action.
See InnerException, if present, for more details.
InnerException:
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 12.3.456.78:8080
It isn't a firewall issue - the firewall on the server that hosts the WCF service doesn't register any requests. It's like Azure just won't fire the request.
My code is very simple:
using (var service = new MyService.ServiceClient())
{
List<MyObject> res = service.GetMyStuff(); // This throws the error
}
I am making a Winforms app that must connect to a ASP.NET WebApi web service that I also made. When I connect to the web service from my computer the Winforms app works, but when I install the Winforms app on some computers it fails to connect to the web service with the following exception:
System.IO.IOException: Can not write data to the transport connection:
The interruption of an existing connection has been forced by the
remote host
The problem is that this error might be due to a connection error or due to bugs in either the Winforms app or the web service and I have no idea what might be the cause. I can connect to the server where the web service is hosted. Are there any server logs that I can use to see what might be the cause of this error and if there are, where do I check them?
I am calling a external API from a WCF service and getting below error.
System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it xx.xx.xxx.1:443
If am making same API from console application then it is working fine.
How can I make same API request working from locally hosted WCF service?
When you run the console app you are communicating with the API under a different account to the one that's used when the WCF service hosted in IIS is communicating to the API.
When it's hosted in IIS, it will be using whatever is set in the Identity section of Advanced settings for the application pool. This will usually be something like 'ApplicationPoolIdentity' or 'NetworkService' etc. It may be that this account used for the Identity is unable to communicate to the API.
One test you can do to rule out issues with the account used for the Identity is to use your domain account for the Identity and see if the communication succeeds (i.e. try impersonation).
I have a WCF Service hosted as a Windows Service in the server.
The endpoint is net.tcp endpoint. We are accessing the endpoints from a Silverlight application.
Problem is when we are trying to access the service from the web app while browsing the Silverlight application using HTTP it works fine. But when we try to do so removing HTTP binding from the Silverlight app from IIS and browse the app using HTTPS the service endpoints are unavailable and gets access permission error from Sockets. I am attaching the error screenshot below:
Could not connect to service. The connection attempt lasted for a time span of 00:00:01.0865926. TCP error code 10061: No connection could be made because the target machine actively refused it. This could be due to attempting to access a service in a cross-domain way while the service is not configured for cross-domain access. You may need to contact the owner of the service to expose a sockets cross-domain policy over HTTP and host the service in the allowed sockets port range.