我正在尝试使用 WCFservice,但我收到 HTTP 413 错误“请求实体太大”。
我使用以下内容配置了 WCF 服务的 web.config:
<system.serviceModel>
<services>
<service name="MyCompany.WCF.Payments.SWPayments" behaviorConfiguration="behaviorPayments">
<endpoint binding="basicHttpBinding" contract="MyCompany.WCF.Payments.Contract.ISWPayments" address="">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="behaviorPayments">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
<behavior name="">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<protocolMapping>
<add binding="basicHttpsBinding" scheme="https" />
</protocolMapping>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_Payments" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
</binding>
</basicHttpBinding>
</bindings>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/>
<client>
<endpoint address="http://server:port/MyCompanyWCFPayments/Payments.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_Payments" contract="MyCompany.WCF.Payments.Contract.ISWPayments" name="BasicHttpBinding_Payments" />
</client>
</system.serviceModel>
如您所见,属性的值设置为最高值。但是我收到了 HTTP 413 错误。
我错过了什么吗?
提前致谢并致以最诚挚的问候。期待您对上面的评论。