我試圖建立遠程服務的響應。在我的web.config中使用以下部分,我收到了來自Web服務的不良響應。C#/ ASP.NET - 遠程服務器返回意外響應:(413)請求實體太大
遠程服務器返回了意外的響應:(413)請求實體太大。我試圖增加緩衝區大小,但無法通過這個錯誤。
我該如何解決這個問題?
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="CustomBinding_ISalesOrderService" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text">
<security mode="Transport"/>
<readerQuotas maxDepth="2000000" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="https://app.vendsys2.com/VendSysAPI/v1.2/SalesOrderService.svc/VendSysAPI/v1.2/SalesReportService.svc"
binding="basicHttpBinding" bindingConfiguration="CustomBinding_ISalesOrderService"
contract="SalesOrderService.ISalesOrderService" name="CustomBinding_ISalesOrderService" />
</client>
</system.serviceModel>
你可以讀這個https://stackoverflow.com/questions/10122957/iis7-413-request-entity-too-large-uploadreadaheadsize 改變basicHttpBinding爲webHttpBinding可能會有所幫助。 – Miguel