这个问题出现的原因是  调用wcf服务的时候传递的参数 长度太大   wcf数据传输采用的默认的大小是65535字节。

----------------------------------------------------------------------------------------------------------

解决方法就是改服务端的webconfig文件  没改之前的文件内容如下

<?xml version="1.0" encoding="utf-8"?>

<!--
有关如何配置 ASP.NET 应用程序的详细信息,请访问
http://go.microsoft.com/fwlink/?LinkId=169433
--> <configuration>
<appSettings>
<add key="Encoding" value="Shift-JIS"/>
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
</system.web> <system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"
multipleSiteBindingsEnabled="true" />
</system.serviceModel>
</configuration>

修改之后:

<?xml version="1.0" encoding="utf-8"?>

<!--
  有关如何配置 ASP.NET 应用程序的详细信息,请访问
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->

<configuration>
  <appSettings>
  
    <add key="Encoding" value="Shift-JIS"/>
  </appSettings>
  <system.web>
    <compilation debug="true" targetFramework="4.5" />
    <httpRuntime targetFramework="4.5" />
  </system.web>

<system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <!--其实要修改所有的服务,不管是服务端还是客户端,Binding那边增加一个没有设置名字的默认配置就OK了-->
        <binding  closeTimeout="00:10:00" receiveTimeout="00:20:00" sendTimeout="00:20:00"
       maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
        </binding >
      </basicHttpBinding>
    </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior name="">
          <!-- 为避免泄漏元数据信息,请在部署前将以下值设置为 false -->
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
          <!-- 要接收故障异常详细信息以进行调试,请将以下值设置为 true。在部署前设置为 false 以避免泄漏异常信息 -->
          <serviceDebug includeExceptionDetailInFaults="True" />
          <dataContractSerializer maxItemsInObjectGraph="2147483647" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" minFreeMemoryPercentageToActivateService="1" />
  </system.serviceModel>
</configuration>

WCF错误远程服务器返回了意外响应: (413) Request Entity Too Large。解决方案的更多相关文章

  1. wcf 远程服务器返回了意外响应: (413) Request Entity Too Large。

    我遇到这个问题的原因是:我使用asp.net 网站调用wcf服务后,通过方法提交数据产生的.我提交的数据是一个实体,包含很多字符串和图片格式的二进制数据超过4M 就报个错误. 后来同事帮忙解决了.他说 ...

  2. WCF 远程服务器返回了意外响应: (400) Bad Request。

    WCF 端  <system.web> <httpRuntime maxRequestLength="2147483647" /> </system. ...

  3. visual studio 远程服务器返回了意外响应:(417)expectation failed

    解决方法: 修改devenv.exe.config文件,添加 <servicePointManager expect100Continue="false" /> C:\ ...

  4. WCF (413) Request Entity Too Large

    有网友碰到过这样的问题:wcf 远程服务器返回了意外响应: (413) Request Entity Too Large. - wsx_net,问题详细内容为:挺不错的博文:wcf 远程服务器返回了意 ...

  5. WCF错误:413 Request Entity Too Large 的一个解决方法

    在我们用WCF传输数据的时候,如果启用默认配置,传输的数据量过大,经常会出这个WCF:413 Request Entity Too Large的错误. WCF包含服务端与客户端,所以这个错误可能出现在 ...

  6. nginx解决超长请求串(413 request Entity too Large错误解决办法)

    <div class="hide-article-box text-center" style="display: block;"> <a c ...

  7. Nginx解决错误413 Request Entity Too Large

    最近一个项目当中,要求上传图片,并且限制图片大小,虽然在laravel当中已经添加了相关的表单验证来阻止文件过大的上传,然而当提交表单时,还没轮到laravel处理,nginx就先报错了.当你仔细看报 ...

  8. 【Azure 应用服务】PHP应用部署在App Service for Linux环境中,上传文件大于1MB时,遇见了413 Request Entity Too Large 错误的解决方法

    问题描述 在PHP项目部署在App Service后,上传文件如果大于1MB就会遇见 413 Request Entity Too Large 的问题. 问题解决 目前这个问题,首先需要分析应用所在的 ...

  9. Nginx出现413 Request Entity Too Large错误解决方法

    Nginx出现的413 Request Entity Too Large错误,这个错误一般在上传文件的时候出现,打开nginx主配置文件nginx.conf,找到http{}段,添加 解决方法就是 打 ...

随机推荐

  1. 2073: [POI2004]PRZ

    2073: [POI2004]PRZ Time Limit: 10 Sec  Memory Limit: 64 MBSubmit: 284  Solved: 213[Submit][Status][D ...

  2. AT1219 歴史の研究 解题报告

    AT1219 歴史の研究 题意 给定一个长为\(n\)的序列\(\{a\}\),询问区间\(a*cnt_a\)的最大值,即某个值乘上出现次数 回退莫队板子 只右移右指针和左指针每次回到块结尾即可. C ...

  3. 上下文管理协议with_open,__enter__和__exit__(三十八)

    在操作文件对象的时候可以这么写 with open('a.txt') as f: '代码块' 上述叫做上下文管理协议,即with语句,为了让一个对象兼容with语句,必须在这个对象的类中声明__ent ...

  4. 安装 scrapy 报错 error: Microsoft Visual C++ 14.0 is required

    问题描述 使用 pip install scrapy 安装 scrapy 时出现以下错误: error: Microsoft Visual C++ 14.0 is required 错误提示中给出了一 ...

  5. Educational Codeforces Round 42 (Rated for Div. 2) D. Merge Equals

    http://codeforces.com/contest/962/problem/D D. Merge Equals time limit per test 2 seconds memory lim ...

  6. 自动清理MySQL binlog日志

    开启MySQL binlog日志的服务器,如果不设置自动清理日志,默认binlog日志一直保留着,时间一长,服务器磁盘空间被binlog日志占满,导致MySQL数据库出错. 使用下面方法可以安全清理b ...

  7. Hadoop记录-Hadoop shell常用命令

  8. Linux记录-筛选日志sed、find、tail,du,awk命令

    1.查看某一段时间的日志 #cat hdfs-audit.log | sed -n '/2018-04-11 10:00:00/,/2018-04-11 10:01:00/ p' | more   - ...

  9. ActiveMQ进阶配置

    配置web管理页面的安全认证 配置web管理页面的绑定IP和端口 配置MQ连接的安全认证 禁用不使用的连接协议 绑定协议连接端口到指定IP 使用MySql作为持久化保存 配置基于JDBC的高可用环境 ...

  10. linux 进程 ctrl-c,ctrl-z,ctrl-d

    linux下: ctrl-c 发送 SIGINT 信号给前台进程组中的所有进程.常用于终止正在运行的程序. ctrl-z 发送 SIGTSTP 信号给前台进程组中的所有进程,常用于挂起一个进程. ct ...