调用SOAP服务时出现超时差异

时间:2016-12-01 10:19:24

标签: wcf

我们正在从dotnet客户端调用java内置的soap服务。以下是客户端的绑定配置。

<binding name="PayerAuthServiceBinding" closeTimeout="00:00:10"
                    openTimeout="00:00:10" receiveTimeout="00:00:10" sendTimeout="00:00:10"
                    allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                    maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                    messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
                    useDefaultWebProxy="false" proxyAddress="http://proxyserver:port">
      <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
          maxBytesPerRead="4096" maxNameTableCharCount="16384" />
      <security mode="Transport">
        <transport clientCredentialType="None" proxyCredentialType="None"
            realm="" />
        <message clientCredentialType="UserName" algorithmSuite="Default" />
      </security>
    </binding>
  </basicHttpBinding>

我们暂时遇到超时问题。但我们发现,在例外情况下,它显示两种不同的超时。一个是实际配置的超时,即00:00:10,另一个是00:00:04.6935638(它在某个时间00:00:03.xxxx或某个时间00:00:09.xxxx变化)。以下异常细节显示相同。

System.TimeoutException: The request channel timed out while waiting for a reply after **00:00:04.6935638**. Increase the timeout value passed to the call to Request or increase the SendTimeout value on the Binding. The time allotted to this operation may have been a portion of a longer timeout. ---> 

System.TimeoutException: The HTTP request to 'http://localhost:8733/DomainService/DataService/' has exceeded the allotted timeout of **00:00:10**. The time allotted to this operation may have been a portion of a longer timeout. ---> System.Net.WebException: The operation has timed out

   at System.Net.HttpWebRequest.GetResponse()
   at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
   --- End of inner exception 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)
   --- End of inner exception stack trace ---

Server stack trace: 
   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 DomainServiceClient.DomainService.IDataService.VefigyEnrollment(VerifyEnrollmentRequest request)
   at DomainServiceClient.DomainService.DataServiceClient.VefigyEnrollment(VerifyEnrollmentRequest request) in D:\Dev\Practice\DataService\DomainService\DomainServiceClient\Service References\DomainService\Reference.cs:line 140
   at DomainServiceClient.MainWindow.ButtonExecute_Click(Object sender, RoutedEventArgs e) in D:\Dev\Practice\DataService\DomainService\DomainServiceClient\MainWindow.xaml.cs:line 24

现在我很困惑,当请求实际上已经超时,如果它在00:00:04.6935638之后超时,那么为什么会这样,以及如何解决这个问题。

寻找您的专家建议。提前谢谢。

0 个答案:

没有答案