从 wcf 服务设置 Maxrecievedmessagesize [英] Setting Maxrecievedmessagesize from wcf service

查看:25
本文介绍了从 wcf 服务设置 Maxrecievedmessagesize的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基本上我有一个 wcf 服务,它返回一个包含 2000 条记录的数据集.当我从应用程序运行该函数时,出现标准错误.

Basically i have a wcf service that returns a dataset of 2000 records. When i run the function from an application i get the standard error.

已超出传入消息的最大消息大小配额 (65536).要增加配额,请在相应的绑定元素上使用 MaxReceivedMessageSize 属性."

"The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element."

现在我知道如何在客户端解决这个问题了.我在徘徊的是,如果我可以在服务器上设置任何选项,将自动导致客户端的 MaxReceivedMessageSize 属性增加.

Now i know how to fix this problem at the client end. What i'm wandering is if there is any options i can set at the server that will automatically cause the MaxReceivedMessageSize property at the client to be increased.

推荐答案

您需要在客户端和服务器端为 MaxReceivedMessageSize 指定更高的限制,以便它们工作.

You need to specify the higher limits for MaxReceivedMessageSize both on the client and the server side in order for them to work.

如果我没记错的话,当您在 Visual Studio 中执行添加服务引用"时,MaxReceivedMessageSize、MaxBufferSize 等的任何设置都将传输到客户端的默认配置文件.

If I remember correctly, any of the settings for MaxReceivedMessageSize, MaxBufferSize etc. will be transferred to the client's default config file when you do a "Add Service Reference" in Visual Studio.

马克

这篇关于从 wcf 服务设置 Maxrecievedmessagesize的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆