Reputation: 2613
I have a client that is running as a windows service to connect to a web service. I have that windows service running on a virtual machine which can access the Web Service from the browser; however, when I try to run the service from the client it does not work.
Here is the Exception:
System.ServiceModel.EndpointNotFoundException: There was no endpoint listening at http://pmht.plexxis.com/clientsdk.asmx 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.0.1.96: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, Exception& exception) --- End of inner exception stack trace --- at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context) at System.Net.HttpWebRequest.GetRequestStream() at System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStream() --- End of inner exception stack trace --- Server stack trace: at System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStream() at System.ServiceModel.Channels.HttpOutput.Send(TimeSpan timeout) at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.SendRequest(Message message, TimeSpan timeout) at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout) at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at Client.Core.PMH.ClientSDKSoap.Login(Int32 ClientId, String Key) at Client.Core.PMH.ClientSDKSoapClient.Login(Int32 ClientId, String Key) at Client.Core.ClientService.OnStart(String[] args)
I tried using Fiddler Web Debugger to determine what was happening; however, to no avail. It shows that nothing is being sent nor received. I also want to note that if I roll back the VM, it works.
Just before this failure started, I rebooted the VM. When the computer started up I saw something about public key certificates; I think it might have something to do with the problem.I googled and tried what was recommended and the result was the same so I'm not 100% sure this has anything to do with the problem. Furthermore, another VM can connect without any problem.
EDIT: Based on comments I tried to ping the site from the VM. The request timed out; however, I then did a ipconfig /flushdns and it started resolving. Unfortunately the same exception was thrown again.
How do I begin to debug this type of problem?
Upvotes: 1
Views: 1837
Reputation: 3281
As discussed in the comments, ensure that the VM is correctly able to resolve the web-service name by attempting to ping the domain.
If it is not able to, try flushing DNS.
Upvotes: 1
Reputation: 114
You may be having two projects, one is Web and other is Services.
To begin the debug with this problem, there may be 2 ways:
1) (a) You have to build and run the Services Project first. (b) Then run the Web Project, it will work.
2)
Go to web.config of your Web Project, you will find your endpoint address like "http://pmht.plexxis.com/clientsdk.asmx" as you mentioned above.
To test that, change it to localhost:2732 and test on your system first.(probably it is 2732, you have to run service layer first and then web)
Also, I need to know that which Web Hosting Service the client is using i.e. Ex. Amazon, Azure etc. ???
The reason for asking this is that IPs get changes in Amazon if you start and stop the instance. Azure has different configurations.
Let me know if I am on right track.
Upvotes: 1