wcf“预计会有更多数据,但已达到EOF。”客户端的例外,但是该请求在服务器端命中

发布于 2025-02-10 03:07:02 字数 1367 浏览 0 评论 0原文

我看到的日志在服务端调用WCF服务(NETTCBINDING)时,在客户端具有以下例外情况。但是,CRUSIAL部分甚至是客户在其应用程序中面临例外的客户,但该请求已成功达到了WCF服务。

消息:预计会有更多数据,但已达到EOF。

消息:在读取消息框架格式时的错误时(状态:开始) 堆栈跟踪:
在System.ServiceModel.Channels.ClientDuplexConnectionReader.ensuredecoderef()
在System.ServiceModel.Channels.SessionConnectionReader.Receive(TimesPan超时)
在System.ServiceModel.Channels.SynchronizedMessagesource.Receive(timespan超时)
在System.ServiceModel.Channels.TransportDuplexsessionChannel.Receive(TimesPan超时)
在System.ServiceModel.Channels.TransportDuplexsessionChannel.treceive(TimesPan超时,消息&消息)
at System.ServiceModel.disPatcher.duplexChannelBinder.Request(消息消息,timespan超时)
at System.ServiceModel.Channels.ServiceChannel.Call(字符串操作,布尔单元,ProxyOperationRuntime操作,对象[] ins,object [] ups [] ups,timespan timepan timeout)
在System.ServiceModel.Channels.Servicechannelproxy.invokeservice(ImethodCallMessage MethodCall,ProxyoPerationRuntime操作)
在System.ServiceModel.Channels.ServiceChannelProxy.Invoke(iMessage消息)例外情况下,

我怀疑这可能是由于以下原因而发生的,因为我看不到由于某些疾病问题而发送到WCF服务的数据。 方案:

  1. 发送到WCF服务的数据可能具有EOF字符。
  2. 发送到WCF服务的数据大小将大于客户端的WCF配置中配置的大小(MaxReceiveMessagesize)。

我试图在本地机器中复制这种情况,无法复制它。 对于第一种情况,我将EOF字节(0x1a)包括在发送到WCF服务的有效载荷数据中。但这并没有在客户端抛出任何例外。 在第二种情况下,我配置了MaxReceivedMessagesize的值小于有效载荷数据大小,它引发了异常,但这是不同的例外。

这个例外的原因是什么? 如何在我的本地复制这个例外?

I am seeing the logs which has the below exception at client side while calling WCF service (NetTcpBinding) in service side. But the crusial part is even the client facing the exception in their application but the request was successfully hit the WCF service.

Message: More data was expected, but EOF was reached.

Message: Error while reading message framing format at position 1 of stream (state: Start)
Stack Trace:
at System.ServiceModel.Channels.ClientDuplexConnectionReader.EnsureDecoderAtEof()
at System.ServiceModel.Channels.SessionConnectionReader.Receive(TimeSpan timeout)
at System.ServiceModel.Channels.SynchronizedMessageSource.Receive(TimeSpan timeout)
at System.ServiceModel.Channels.TransportDuplexSessionChannel.Receive(TimeSpan timeout)
at System.ServiceModel.Channels.TransportDuplexSessionChannel.TryReceive(TimeSpan timeout, Message& message)
at System.ServiceModel.Dispatcher.DuplexChannelBinder.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

I suspect it may be occured due to below reasons, since i could not see the data that was sent to the WCF service due to some scurity issue.
Scenarios:

  1. The data that was sent to the WCF service might have EOF character.
  2. The data size that was sent to the WCF service would be larger than the size that was configured (maxReceivedMessageSize) in the WCF configuration at client side.

I was trying to reproduce the scenario in my local machine, i am unable to reproduce it.
For the first scenario, i included the EOF byte (0x1A) in the payload data to sent to WCF service. but it does not throw any exception at client side.
for the second scenario, i configured the maxReceivedMessageSize value less than the payload data size, it throws the exception, but it was different exception.

What could be the reason for this exception?
How to reproduce this exception in my local?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

野心澎湃 2025-02-17 03:07:02

问题是由于负载平衡器超时配置。

当WCF服务处理请求比负载平衡器配置时间更多时,EOF例外情况在客户端发生。

感谢@lan Huang向我导航到正确的方向。

The issue is because of load balancer timeout configuration.

The EOF exception is occurred at client side, when the WCF service processes the request more than load balancer configuration time.

Thanks @Lan Huang for navigating me to the right direction.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文