远程服务器返回了意外的响应。 (413)请求的实体过大 [英] Remote server returned an unexpected response. (413) Requested entity too large

查看:2879
本文介绍了远程服务器返回了意外的响应。 (413)请求的实体过大的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我从我的WP7上传照片到我的WCF Web服务,我得到'413请求实体太大',无论我做什么,我不能阻止它发生。

When I upload a photo from my WP7 to my WCF web service I get '413 Request Entity Too Large', and no matter what I do, I cannot stop it from happening.

我的网络服务的绑定信息是:

My binding information for the web service is:

<bindings>
  <basicHttpBinding>
    <binding name="uploadfilebinding" closeTimeout="10:01:00"
      maxBufferSize="2147483646" maxBufferPoolSize="2147483646"
      maxReceivedMessageSize="2147483646" openTimeout="10:01:00"
      receiveTimeout="10:10:00" sendTimeout="10:01:00"
      messageEncoding="Mtom" transferMode="StreamedRequest">
      <readerQuotas maxDepth="2147483646" maxStringContentLength="2147483646"
                    maxArrayLength="2147483646" maxBytesPerRead="2147483646"
                    maxNameTableCharCount="2147483646" />
    </binding>
  </basicHttpBinding>
</bindings>

正如你可以看到,我已经设置maxReceivedMessageSize到最高我可以,但没有效果,帮助我?

As you can see I have set maxReceivedMessageSize to the highest I can, but to no avail, Can anyone help me please?

我的服务器是Windows Server 2008 R2 Standard,服务在.NET 4下运行。

My server is 'Windows Server 2008 R2 Standard' and the service is running under .NET 4.

提前感谢,

感谢您的回复:

因为这是一个WP7应用程序,客户端配置文件是一个名为ServiceReferences.ClientConfig的隐藏文件,由服务创建,现在的绑定:

As this is a WP7 app, the client configuration file is a hidden file called 'ServiceReferences.ClientConfig' that is created by the service, and the binding in there is now:

<bindings>
  <basicHttpBinding>
    <binding name="BasicHttpBinding_IMbcSync" closeTimeout="10:01:00"
      maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" openTimeout="10:01:00"
      receiveTimeout="10:10:00" sendTimeout="10:01:00"
      transferMode="StreamedResponse">
    </binding>
  </basicHttpBinding>
</bindings>

但我仍然收到相同的错误。

But I'm still getting the same error. Any more suggestions would be much appreciated?

Lee

推荐答案

是多个地方,你可以增加到最大可能的大小。其中一些是WCF相关的,其中一些是IIS相关的。除了注释中提到的选项,尝试增加服务器端配置文件中的以下内容(maxRequestLength和maxAllowedContentLength)以照顾IIS端:

There are multiple places that you may increase to the maximum possible size. Some of them are WCF related and some of them are IIS related. In addition to the options mentioned in the comments, try to increase the followings (maxRequestLength, and maxAllowedContentLength) in your config file on the server side to take care of the IIS side too:

<system.web>
  <httpRuntime maxRequestLength="2147483647" useFullyQualifiedRedirectUrl="true"   executionTimeout="14400"/>
</system.web>

  <system.webServer>
   <modules runAllManagedModulesForAllRequests="true"/>
    <security>
     <requestFiltering allowDoubleEscaping="true">
      <requestLimits maxAllowedContentLength="2147483647"/>
      <fileExtensions allowUnlisted="true"/>
      <verbs allowUnlisted="true"/>
     </requestFiltering>
    </security>
  </system.webServer>

这篇关于远程服务器返回了意外的响应。 (413)请求的实体过大的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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