<?xml version="1.0" encoding="utf-8"?>
<configuration>
<connectionStrings>
<add name="connStr" connectionString=""/>
</connectionStrings>
<appSettings>
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5"/>
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<!--<behavior>
--><!-- 为避免泄漏元数据信息,请在部署前将以下值设置为 false --><!--
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
--><!-- 要接收故障异常详细信息以进行调试,请将以下值设置为 true。在部署前设置为 false 以避免泄漏异常信息 --><!--
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>-->
<behavior name="MyBehavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<protocolMapping>
<add binding="basicHttpsBinding" scheme="https" />
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
<services>
<service behaviorConfiguration="MyBehavior" name="WcfService.Service1">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="NewBinding0"
contract="WcfService.IService1" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<bindings>
<basicHttpBinding>
<binding name="NewBinding0"
closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
maxBufferSize="" maxBufferPoolSize="" maxReceivedMessageSize=""
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
<readerQuotas maxDepth="" maxStringContentLength="" maxArrayLength="" maxBytesPerRead="" maxNameTableCharCount=""/>
<security mode="None" />
</binding>
</basicHttpBinding>
</bindings> </system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<!--
若要在调试过程中浏览 Web 应用程序根目录,请将下面的值设置为 True。
在部署之前将该值设置为 False 可避免泄露 Web 应用程序文件夹信息。
-->
<directoryBrowse enabled="true"/>
</system.webServer> </configuration>

服务器Web.config

 <?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
</configSections>
<connectionStrings> </connectionStrings>
<appSettings> </appSettings>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IService1" maxBufferSize="" maxReceivedMessageSize="" /> </basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:16583/Service1.svc" binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_IService1" contract="ServiceData.IService1"
name="BasicHttpBinding_IService1" />
</client>
</system.serviceModel> </configuration>

客户端App.config

客户端调用的时候加上这一段代码即可:

ServiceData.Service1Client client = new ServiceData.Service1Client();
(client.Endpoint.Binding as BasicHttpBinding).MaxReceivedMessageSize = int.MaxValue;
(client.Endpoint.Binding as BasicHttpBinding).MaxBufferPoolSize = int.MaxValue;
(client.Endpoint.Binding as BasicHttpBinding).MaxBufferSize = int.MaxValue;

WCF已超过传入消息(65536)的最大消息大小配额。若要增加配额,请使用相应绑定元素上的 MaxReceivedMessageSize 属性的更多相关文章

  1. WebService 之 已超过传入消息(65536)的最大消息大小配额。若要增加配额,请使用相应绑定元素上的 MaxReceivedMessageSize 属性。

    在使用 WCF 中,遇到如下问题: 已超过传入消息(65536)的最大消息大小配额.若要增加配额,请使用相应绑定元素上的 MaxReceivedMessageSize 属性. 问题说明: 客户端调用 ...

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

    错误:已超过传入消息(65536)的最大消息大小配额.若要增加配额,请使用相应绑定元素上的 MaxReceivedMessageSize 属性. 或者 错误:反序列化操作“GetAllUserData ...

  3. WCF请求数据:已超过传入消息(65536)的最大消息大小配额。若要增加配额,请使用相应绑定元素上的 MaxReceivedMessageSize 属性。

    通常情况下,写好WCF服务后都会用自带的WCFClient工具进行测试,在进行时数据请求的时候,如果返回数据量超过默认接收值的时候就会提示如图异常错误. 错误也提示的很清楚,无非就是修改接收值大小的问 ...

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

    我出现这个问题主要是服务器返回数据量过大引起了,需要客户端服务端都要进行配置:我会说其实有神器的么....(工具=>wcf服务配置编辑器),用工具编辑下,就会完全搞定这个问题,再也不用纠结了 服 ...

  5. System.ServiceModel.CommunicationException: 已超过传入消息(65536)的最大消息大小配额。若要增加配额,请使用相应绑定元素上的 MaxReceivedMessageSize 属性。

  6. WCF已超过传入消息(65536)的最大消息大小配额的解决方法

    在服务端和客户端的配置文件中添加修改节点 maxReceivedMessageSize="1000000000" ; 或者通过编程设置bind.MaxReceivedMessage ...

  7. MaxReceivedMessageSize :已超过传入消息(65536)的最大消息大小配额

    做的windows应用程序(后台调用webservice),数据量大的时候,报错如下: System.ServiceModel.CommunicationException: 已超过传入消息(6553 ...

  8. WebService出错 Maximum message size quota for incoming messages (65536) has been exceeded.已超过传入消息(65536)的最大消息大小配额

    WebService应用中如果收到的信息非常大时出错. 1:Maximum message size quota for incoming messages (65536) has been exce ...

  9. 调用WCF时,调用已超过传入消息(65536)的最大消息大小配额。若要增加配额,请使用相应绑定。

    解决方案: 其实只要在客户端配置文件中加上如下紫色粗体属性( maxReceivedMessageSize): <?xml version="1.0" encoding=&q ...

随机推荐

  1. leetcode简单题目两道(2)

    Problem Given an integer, write a function to determine if it is a power of three. Follow up: Could ...

  2. 吴恩达《深度学习》第四门课(3)目标检测(Object detection)

    3.1目标定位 (1)案例1:在构建自动驾驶时,需要定位出照片中的行人.汽车.摩托车和背景,即四个类别.可以设置这样的输出,首先第一个元素pc=1表示有要定位的物体,那么用另外四个输出元素表示定位框的 ...

  3. javascript图形动画设计--画简单正弦波

        <!doctype html> <html> <head> <meta charset="utf-8"> <title ...

  4. unity TileMap 简述

    主要工具 说明 更多说明 Sprite 精灵,纹理的容器. 大型纹理图集可以转为精灵图集(Sprite Sheet). Tile 瓦片,包含一个精灵,以及两个属性,颜色和碰撞体类型.   Tilema ...

  5. js 写日期选择器

    <html> <head> <title>Js日期选择器并自动加入到输入框中</title> <meta http-equiv="con ...

  6. Redis---1、介绍

    Redis简介: 是以key-value形式存储,和传统的关系型数据库不一样,不一定遵循传统数据库的一些基本要求. 优点: 对数据高并发读写 对海量数据的高效率存储和访问 对数据的可扩展性和高可用行 ...

  7. qq iOS环境配置及调用

    1.下载官方iOS sdk:地址:相关文档 2. 将iOS SDK中的TencentOpenAPI.framework和TencentOpenApi_IOS_Bundle.bundle文件拷贝到应用开 ...

  8. Thymeleaf学习记录(2)--自动编译设置

    了方便每次修改HTML文件都能实时刷新,做一下更改. 在application.properties文件加入以下命令: #thymeleaf start spring.thymeleaf.mode=H ...

  9. csharp: SQL Server 2005 Database Backup and Restore using C#

    1.第一种方式: using SQLDMO;//Microsoft SQLDMO Object Library 8.0 /// <summary> /// 数据库的备份 /// 涂聚文注: ...

  10. P1025[SCOI2009]游戏

    windy学会了一种游戏.对于1到N这N个数字,都有唯一且不同的1到N的数字与之对应.最开始windy把数字按 顺序1,2,3,……,N写一排在纸上.然后再在这一排下面写上它们对应的数字.然后又在新的 ...