WCF服务在生产服务器上给出错误

时间:2011-04-22 12:34:39

标签: asp.net wcf wcf-client

我的Production Server上遇到了一个奇怪的问题。 M调用WCF服务以获取数据并获取异常

Timestamp: 4/22/2011 9:50:01 AM
Message: System.ServiceModel.EndpointNotFoundException: There was no endpoint listening at [ServiceAdress] 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 [Server IP]
   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(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.HttpRequestChannel.HttpChannelRequest.SendRequest(Message message, TimeSpan timeout)
   at System.ServiceModel.Channels.RequestChannel.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)

出于测试目的并获得实际异常,我制作了一个控制台应用程序并且只是调用该服务。当我在本地+开发服务器和控制台应用程序上运行时运行结果运行良好,但当我在我的生产中运行时服务器它给出了这个错误。

我想知道有什么东西需要检查我的生产环境吗? 我有检查,那里没有防火墙(防火墙阻塞的可能性)但是根本没有防火墙..

请帮助我有没有我可以检查/做的事情来运行mu应用程序?

问候并感谢

*的 修改 *

我想在此添加的一件事是。我的网站在那里托管,该网站正在调用该服务和geting例外。为简单起见,我在调用该服务时创建了一个Console应用程序,并在Both Dev和Production(托管webSite)上运行该应用程序。

控制台应用程序在开发时运行良好 控制台应用程序会在生产

上出错

2 个答案:

答案 0 :(得分:0)

检查以下端点地址: 您正在使用的协议和端点地址以及在服务和客户端中定义的端口。

如果您正在使用WAS,请通过右键单击已定义应用程序池中的服务来检查为服务定义的设置。还要测试IE中定义的端点地址,如果它显示OUTput,那么它将与应用程序一起运行。

答案 1 :(得分:0)

使用SvcConfigEditor编辑配置文件添加跟踪。然后使用SvcTraceViewer打开跟踪文件,看看您是否正在拨打正确的服务,或者您可以找到有关该问题的更多信息。