如何向 WCF 服务发送大消息?
我在 WCF 服务中有一个 DataContract。它有一个数组,我在客户端代码中设置该数组。如果我将数组设置为超过 1000,000,则会抛出错误,指出 BadRequest。 System.ServiceModel.ProtocolException:远程服务器返回意外响应 (400) 错误请求。
如何克服这个问题?我想向该服务发送更多数据。
I have one DataContract in the WCF service.In that it has one Array and i am setting that array in the Client code. If I set the array to more than 1000 thousand its throwing up an error saying BadRequest.
System.ServiceModel.ProtocolException : The Remote server returned an unexpected response (400) Bad Request.
How to overcome this? I want to send more data to the service.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试增加消息允许的大小。您需要设置服务和客户端端点才能使用绑定配置。
如果您尝试发送的数据无法满足上述配置允许的消息大小,则您需要研究发送更少数据或在多个请求中执行此操作的方法。
您可以查看此问题以获取相关信息。
You can try to increase the size allowed for a message. You'll need to set both the service and the client endpoint to use the binding configuration.
If the data you are trying to send cannot fit within the message size allowed by the above configuration, you'll need to look into ways to either send less data or do it in multiple requests.
You can see this question for related information.