我得到“远程服务器返回错误:(413)请求实体太大”错误,而我试图使用我的MVC应用程序访问wcf中的保存方法,我仔细检查了我的web.config一切似乎都正确,我自从两天以来我一直试图解决这个问题,我尝试了一些我在谷歌上发现的但是我失败了,请帮我解决这个问题。
这是来自MVC app(客户端)的web.config中的system.servicemodel
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="IPersonProfileServiceEndpoint" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2000000" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security mode="Transport">
<transport clientCredentialType="Windows" />
</security>
</binding>
<binding name="IClientAssessmentEndpoint" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2000000" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security mode="None">
<transport clientCredentialType="Basic" />
</security>
</binding>
<binding name="ICMSServiceEndpoint" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2000000" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security mode="None">
<transport clientCredentialType="Basic" />
</security>
</binding>
<binding name="BasicHttpBinding_ICMSService" />
</basicHttpBinding>
<wsHttpBinding>
<binding name="IPersonProfileServiceEndpoint" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2000000" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security mode="Transport">
<transport clientCredentialType="Windows" />
</security>
</binding>
<binding name="ICMSServiceEndpoint" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2000000" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security mode="Transport">
<transport clientCredentialType="Windows" />
</security>
</binding>
<binding name="IClientAssessmentEndpoint" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2000000" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security mode="Transport">
<transport clientCredentialType="Windows" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="https://servicetest.iltest.illinois.gov/AGE/PersonProfile/PersonProfileWCFService.svc" binding="wsHttpBinding" bindingConfiguration="IPersonProfileServiceEndpoint" contract="PersonProfileWCFService.IPersonProfileWCFService" name="IPersonProfileServiceEndpoint">
<identity>
<dns value="illinois.gov" />
</identity>
</endpoint>
<endpoint address="http://localhost:24500/Services/ClientAssessmentService.svc" binding="basicHttpBinding" bindingConfiguration="IClientAssessmentEndpoint" contract="ClientAssessmentWCF.IClientAssessment" name="IClientAssessmentEndpoint" />
<endpoint address="http://localhost:24500/Services/CMSService.svc" binding="basicHttpBinding" bindingConfiguration="ICMSServiceEndpoint" contract="CMSService.ICMSService" name="ICMSServiceEndpoint" />
</client>
<behaviors>
<serviceBehaviors>
<behavior name="debug">
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<protocolMapping>
<add binding="basicHttpsBinding" scheme="https" />
</protocolMapping>
<!--<services>
<service name="TestService" behaviorConfiguration="debug" />
</services>-->
下面是来自wcf Project(server)的web.config中的system.servicemodel
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehavior">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="false" />
<serviceDebug httpHelpPageEnabled="true" includeExceptionDetailInFaults="true" />
</behavior>
<behavior name="">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<protocolMapping>
<add binding="basicHttpsBinding" scheme="https" />
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBindingConfig" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00">
<readerQuotas maxDepth="2000000" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security mode="Transport">
<transport clientCredentialType="Windows" />
</security>
</binding>
</basicHttpBinding>
<!--<wsHttpBinding>
<binding name="wsHttpBindingConfig" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00">
<readerQuotas maxDepth="2000000" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security mode="Transport">
<transport clientCredentialType="Windows" />
</security>
</binding>
</wsHttpBinding>-->
</bindings>
<services>
<!--<service name="CMS.WCFApp.Services.CaseManagementService" behaviorConfiguration="ServiceBehavior">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="BasicHttpBindingConfig" bindingNamespace="http://localhost:24500/Services/CaseManagementService.svc" name="ICaseManagementServiceEndpoint" contract="CMS.WCFApp.ServiceContract.ICaseManagementService">
--><!--<identity>
<dns value="illinois.gov"/>
</identity>-->
<!--
</endpoint>
</service>
<service name="CMS.WCFApp.Services.ClientAssessmentService" behaviorConfiguration="ServiceBehavior">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="BasicHttpBindingConfig" bindingNamespace="http://localhost:24500/Services/ClientAssessmentService.svc" name="IClientAssessmentEndpoint" contract="CMS.WCFApp.ServiceContract.IClientAssessment">
-->
<!--<identity>
<dns value="illinois.gov"/>
</identity>--><!--
</endpoint>
</service>-->
<service name="CMS.WCFApp.Services.CMSService.svc" behaviorConfiguration="ServiceBehavior">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="BasicHttpBindingConfig" bindingNamespace="http://localhost:24500/Services/CMSService.svc" name="ICMSServiceEndpoint" contract="CMS.WCFApp.ServiceContract.ICMSService">
<!--<identity>
<dns value="illinois.gov"/>
</identity>-->
</endpoint>
</service>
<!--<service name="CMS.WCFApp.Services.CManagementService" behaviorConfiguration="ServiceBehavior">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="BasicHttpBindingConfig" bindingNamespace="http://localhost:24500/Services/CManagementService.svc" name="ICManagementServiceEndpoint" contract="CMS.WCFApp.ServiceContract.ICManagementService">
--><!--<identity>
<dns value="illinois.gov"/>
</identity>--><!--
</endpoint>
</service>-->
</services>
答案 0 :(得分:0)
这是一个常见的错误。我想它是你的服务器端web配置。尝试将相同的配置添加到您的客户端,您的问题将解决。