2014-07-15 61 views
0

我一直得到从我的QA服务器的以下错误:无法解析WCF超时错误

Message: { strMessage = Class: ShopProcessServiceClient Method: Main Error: An error occurred while receiving the HTTP response to http://xxx.xxx.x.xxx/RyderShopProcessService/ShopProcessService.svc . This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details. InnerException: System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags) at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) --- End of inner exception stack trace --- at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) at System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size) at System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead) --- End of inner exception stack trace --- at System.Net.HttpWebRequest.GetResponse() at System.ServiceModel.Channels.HttpChannelFactory 1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout) Source: mscorlib StackTrace: Server stack trace: at System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebException webException, HttpWebRequest request, HttpAbortReason abortReason) at System.ServiceModel.Channels.HttpChannelFactory 1.HttpRequestChannel.HttpChannelRequest.WaitForReply(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 Ryder.ShopProcessService.Outbound.ShopProcessService.IShopProcessService.GetCusts() at Ryder.ShopProcessService.Outbound.ShopProcessService.ShopProcessServiceClient.GetCusts() in c:\Development\SMO_VS_2013\HHOutboundClient\SOASolutionA\Ryder.ShopProcessService.Outbound\Service References\ShopProcessService\Reference.cs:line 7698 at Ryder.ShopProcessService.Outbound.ShopProcessServiceClient.Main(String[] args) in c:\Development\SMO_VS_2013\HHOutboundClient\SOASolutionA\Ryder.ShopProcessService.Outbound\ShopProcessServiceClient.cs:line 399, strProject = Ryder.ShopProcessService.Outbound, strRemedyTktResponse = INC000000091594 } Extended Properties:

在查找在上面的​​文字相关的错误,他们都指向要么增加发送/接收超时和或最大化正在发送的数据值(如maxItemsInObjectGraph =“2147483647”)我已经完成并仍然无法解决此错误。

的事情是,当我 Visual Studio中运行从相同设置相同应用,没有错误发生只有在我们的QA服务器上运行时才会发生。

在处理大约170,000条记录左右的相同集合时,它总是崩溃。下一个最大的是大约50,000条记录。它确实让它过去了一次,但后来的尝试失败了。

在我感兴趣的错误的另一件事是: System.IO.IOException:无法从传输连接

另外值得注意的读取数据的事实是,我有一个命令超时(为了执行sql,尽管在调试之后,仅需要几秒钟)5分钟,当5分钟到达时,发生错误。当我将命令超时并将其保留为默认值时,它会在默认值时间崩溃。这可能告诉我它在读取数据库中的数据时遇到了麻烦。

如果有人能告诉我我还能改变什么来解决这个错误,我将不胜感激。

下面是我的服务相关web.config文件设置:

<system.serviceModel> 
    <client> 
     <endpoint address="http://999.999.99.999/RyderCommonServices/ContentManagementService.svc" 
     binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ContentManagementService" 
     contract="ContentManagementService.ContentManagementService" 
     name="BasicHttpBinding_ContentManagementService" /> 
    </client> 
    <services> 
     <service name="Ryder.ShopProcessService.SOA.ShopProcessService" behaviorConfiguration="ServiceBehavior"> 
     <endpoint address="" binding="wsHttpBinding" contract="Ryder.ShopProcessService.SOA.IShopProcessService" bindingConfiguration="WsHttpBinding_IShopProcessService"> 
     </endpoint> 
     <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> 
     <host> 
      <baseAddresses> 
      <!--<add baseAddress="\\miavdeteoabweb\c$\inetpub\Dev\RyderShopProcessService" />--> 
      </baseAddresses> 
     </host> 
     </service> 
    </services> 
    <bindings> 
     <wsHttpBinding> 
     <binding name="WsHttpBinding_IShopProcessService" closeTimeout="00:10:00" 
      openTimeout="00:10:00" receiveTimeout="00:30:00" sendTimeout="00:30:00" 
      maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"> 
      <readerQuotas maxStringContentLength="2147483647" maxArrayLength="2147483647" 
      maxBytesPerRead="2147483647" /> 
      <security mode="None" /> 
     </binding> 
     </wsHttpBinding> 
    </bindings> 
    <diagnostics wmiProviderEnabled="false" performanceCounters="All"> 
     <messageLogging logMessagesAtTransportLevel="true" logMessagesAtServiceLevel="true" logMalformedMessages="true" logEntireMessage="true" maxSizeOfMessageToLog="2147483647" maxMessagesToLog="500" /> 
    </diagnostics> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior name="ServiceBehavior"> 
      <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/> 
      <serviceDebug includeExceptionDetailInFaults="true"/> 
      <dataContractSerializer maxItemsInObjectGraph="2147483647" /> 
      </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    <protocolMapping> 
     <!--<add scheme="http" binding="basicHttpBinding"/>--> 
     <add scheme="https" binding="wsHttpBinding"/> 
    </protocolMapping> 
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" /> 
    </system.serviceModel> 
    <system.webServer> 
    <modules runAllManagedModulesForAllRequests="true" /> 
    <security> 
     <requestFiltering> 
     <requestLimits maxAllowedContentLength="2147483647" /> 
     </requestFiltering> 
    </security> 

这是我的客户相关的app.config设置:

<system.serviceModel> 
    <bindings> 
     <wsHttpBinding> 
     <binding name="WsHttpBinding_IShopProcessService" closeTimeout="00:10:00" 
      openTimeout="00:10:00" receiveTimeout="00:30:00" sendTimeout="00:30:00" 
      maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"> 
      <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" 
      maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> 
      <security mode="None" /> 
     </binding> 
     <binding name="WSHttpBinding_IShopProcessService"> 
      <security mode="None" /> 
     </binding> 
     </wsHttpBinding> 
    </bindings> 
    <diagnostics wmiProviderEnabled="true"> 
     <messageLogging logMessagesAtTransportLevel="true" logMessagesAtServiceLevel="true" logMalformedMessages="true" logEntireMessage="true" maxSizeOfMessageToLog="2147483647" maxMessagesToLog="100" /> 
    </diagnostics> 
    <client> 
     <endpoint address="https://ryderfitest.velsol.com/RyderDataPortal/RyderService.svc" 
     behaviorConfiguration="BasicHttpBinding_RyderService" binding="basicHttpBinding" 
     bindingConfiguration="BasicHttpBinding_RyderService" contract="HHOutBoundService.IRyderService" 
     name="BasicHttpBinding_RyderService" /> 
     <endpoint address="http://999.999.9.999/RyderShopProcessService/ShopProcessService.svc" behaviorConfiguration="WsHttpBinding_IShopProcessService" 
       binding="wsHttpBinding" bindingConfiguration="WsHttpBinding_IShopProcessService" 
       contract="ShopProcessService.IShopProcessService" name="WsHttpBinding_IShopProcessService" /> 
    </client> 
    <behaviors> 
     <endpointBehaviors> 
     <behavior name="WsHttpBinding_IShopProcessService"> 
      <dataContractSerializer maxItemsInObjectGraph="2147483647"/> 
     </behavior> 
     <behavior name="webhttp"> 
      <webHttp/> 
     </behavior> 
     <behavior name="BasicHttpBinding_RyderService"> 
      <dataContractSerializer maxItemsInObjectGraph="2147483647"/> 
     </behavior> 
     </endpointBehaviors> 
    </behaviors> 
    </system.serviceModel> 
+0

没有WCF本身的源代码,我们没有太多的东西可以检查。你可以在QA服务器上登录吗?如果可能的话,在您将其发送到客户端之前,以及在从服务器上的套接字读取它之后立即创建每条记录的数据加载。如果它可能是数据源中的错误,或者只是因超时而超时,可以给你一个想法。我个人的猜测是你的客户端应用程序不能保持连接打开时间足够长。 – Nzall

+0

不允许登录QA服务器......如果我的客户端应用程序无法保持连接打开时间足够长,应该更改什么WCF设置以及如何更改?这是发送/接收超时设置吗?我现在拥有他们30分钟。什么是我可以设置的确切最大发送/接收超时值? – sagesky36

回答

0

我解决更新发送/接收/打开/关闭超时的错误。见下文。

<binding name="WsHttpBinding_IShopProcessService" closeTimeout="00:30:00" 
      openTimeout="00:30:00" receiveTimeout="00:30:00" sendTimeout="00:30:00" 
      maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"> 
      <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" 
      maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> 
      <security mode="None" /> 
     </binding>