WCF Soap错误:请求实体太大

时间:2019-01-24 09:53:26

标签: c# wcf iis soap-client .net-framework-version

当我将大数据发送到WCF Web服务时遇到问题。我不能通过https进行肥皂处理,但可以通过http进行肥皂处理。我尝试在web.config和IIS中进行配置以发送大数据,但它仍然响应:413请求实体太大。

web.config

<appSettings>
   <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
</appSettings>

<system.web>
   <compilation targetFramework="4.5" />
   <httpRuntime targetFramework="4.5"/>
</system.web>

<system.serviceModel>
   <bindings>
      <basicHttpBinding>
         <binding maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647">
            <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
         </binding>
         <binding name="BasicHttpBinding_IDigitalSigningService" receiveTimeout="00:10:00" sendTimeout="00:10:00" openTimeout="00:10:00" closeTimeout="00:10:00" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" maxBufferPoolSize="2147483647" transferMode="Buffered" messageEncoding="Text" textEncoding="utf-8" bypassProxyOnLocal="false" useDefaultWebProxy="true">
            <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
            <security mode="TransportWithMessageCredential" />
         </binding>
      </basicHttpBinding>
   </bindings>
   <client>
      <endpoint address="https://localhost:8444/Service/DigitalSigningService.svc"
    binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IDigitalSigningService"
    contract="DigitalSignServiceReference.IDigitalSigningService" name="BasicHttpBinding_IDigitalSigningService" />
   </client>

   <behaviors>
      <serviceBehaviors>
         <behavior>
            <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
            <serviceDebug includeExceptionDetailInFaults="false"/>
         </behavior>
      </serviceBehaviors>
   </behaviors>

   <protocolMapping>
      <add binding="basicHttpsBinding" scheme="https" />
   </protocolMapping>

   <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>

<system.webServer>
   <modules runAllManagedModulesForAllRequests="true"/>
   <directoryBrowse enabled="true"/>
</system.webServer>

IIS config

Https

----------------------更新----------------------

现在我可以用肥皂擦洗。我的错误是我没有配置

<basicHttpsBinding>...</basicHttpsBinding>

仅配置

<basicHttpBinding>...<basicHttpBinding>

谢谢大家为我提供帮助

0 个答案:

没有答案