简体   繁体   English

远程服务器返回了意外的响应:(413)请求实体太大(服务配置与客户端配置)

[英]The remote server returned an unexpected response: (413) Request Entity Too Large (service config vs client config)

There are a number of post already out there but I cannot get this to work. 已经有很多帖子了,但是我无法使它正常工作。 The posts suggest to define the tags endpoints and binding both client side and server side. 这些帖子建议定义标签端点并绑定客户端和服务器端。 All I have is the applications web.config file. 我所拥有的只是应用程序的web.config文件。 How do I make the distinction between client side and server side. 如何区分客户端和服务器端。 In my web.config, i defined a services tag, but it seems as if it is not used as the face binding configurations defined in there is never called out when debugging. 在我的web.config中,我定义了一个服务标签,但似乎没有使用它,因为在调试时从未调出其中定义的面部绑定配置。 My web.config looks like this: 我的web.config看起来像这样:

<?xml version="1.0"?>

<configuration>
  <configSections>
     <sectionGroup name="****" type="****, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=*********" >
       <section name="********" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=*********" requirePermission="false" />
     </sectionGroup>
  </configSections>
  <system.serviceModel>
    <bindings>
       <basicHttpBinding>
           <binding name="binding1_IService" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true" messageEncoding="Text">
               <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
               <security mode="None">
                    <transport clientCredentialType="None" proxyCredentialType="None" realm="" />
                    <message clientCredentialType="UserName" algorithmSuite="Default" />
               </security>
            </binding>
            <binding name="binding2_IService" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true" messageEncoding="Text">
                <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
                <security mode="None">
                     <transport clientCredentialType="None" proxyCredentialType="None" realm="" />
                     <message clientCredentialType="UserName" algorithmSuite="Default" />
                </security>
            </binding>
       </basicHttpBinding>
    </bindings>
    <client>
        <endpoint address="http:aaa.com/bbb.xamlx" binding="basicHttpBinding" bindingConfiguration="binding1_IService" contract="App.IAppService"  />
        <endpoint address="http:aaa.com/bbb.xamlx" binding="basicHttpBinding" bindingConfiguration="binding2_IService" contract="App2.IApp2Service"  />
    </client>
    <behaviors>
        <serviceBehaviors>
            <behavior>
                <serviceMetadata httpGetEnabled="true"/>
                <serviceDebug includeExceptionDetailInFaults="true"/>
            </behavior>
        </serviceBehaviors>
    </behaviors>

   <!--Not sure this is where to put this and if it is correct -->
   <services>
     <service  name="namespace.classname">
        <endpoint  address="http:aaa.com/bbb.xamlx" binding="basicHttpBinding" contract="App.IAppService" bindingConfiguration="binding1.IService" />
        <endpoint address="http:aaa.com/bbb.xamlx" binding="basicHttpBinding" contract="App.IAppService2" bindingConfiguration="binding2.IService" />
      </service>
  </services>
  <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
  <system.web>
     <customErrors mode="Off" />
     <compilation debug="true" targetFramework="4.0" />
     <authentication mode="Windows" />
     <authorization>
         <deny users="?"/>
     </authorization>
  </system.web>
 <system.webServer>
      <modules runAllManagedModulesForAllRequests="true"/>
 </system.webServer>
 <connectionStrings>
 <add name="name" connectionString="string" providerName="System.Data.EntityClient" />
 </connectionStrings>
</configuration>

I keep getting the error above when uploading non-text files. 上载非文本文件时,我不断收到上述错误。 Any help please... 任何帮助请...

I got the same issue with xamlx (Windows Workflow Foundation Web Services), and I tried a bunch of WCF solutions with no success, but I found the following solution on the asp.net forum; 我在xamlx(Windows Workflow Foundation Web服务)上遇到了同样的问题,并且尝试了很多WCF解决方案,但均未成功,但是我在asp.net论坛上找到了以下解决方案。 which worked perfectly even on IIS Express. 即使在IIS Express上也可以完美运行。

Reference: Problem with XAMLX service in .Net 4.0 参考: .Net 4.0中的XAMLX服务问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 WCF服务异常远程服务器返回了意外的响应:(413)请求实体太大 - WCF Service Exception The remote server returned an unexpected response: (413) Request Entity Too Large 错误:远程服务器返回了意外的响应:(413)请求实体太大 - Error: the remote server returned an unexpected response: (413) Request Entity Too Large 文件上传,远程服务器返回错误:(413) Request Entity Too Large - File Upload, The remote server returned an error: (413) Request Entity Too Large WCF服务(413)请求实体中的文件上传过大 - File upload in WCF Service (413) Request Entity Too Large (413)WCF中的请求实体太大 - (413) Request Entity Too Large in WCF 413 请求实体太大 - Web API - 413 request entity too large - Web API WCF不允许大量列表。 引发“远程服务器返回了意外的响应:(400)错误的请求。”异常 - WCF not allowing large list . Throwing “The remote server returned an unexpected response: (400) Bad Request.” exception ASP.NET web 服务413请求实体太大错误 - ASP.NET web service 413 request entity too large error 混合内容问题和 413(请求实体太大) - Mixed Content problem and 413 (Request Entity Too Large) 413:IIS Web 服务上的请求实体太大错误 - 413: Request Entity Too Large error on IIS webservice
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM