0

I'm facing Issue when I send big data to WCF web service. I cannot soap by https but I can soap by http. I try to config in web.config and IIS for send big data but it still response : 413 Request Entity Too Large.

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

---------------------- Update ----------------------

Now I can soap it. My mistake is I'm not config

<basicHttpsBinding>...</basicHttpsBinding>

I config only

<basicHttpBinding>...<basicHttpBinding>

Thank you all for try to help me

Damien_The_Unbeliever
  • 234,701
  • 27
  • 340
  • 448
  • It would be awesome if you could provide a [mcve]. It is key that the content is in the question, not behind external links. – mjwills Jan 24 '19 at 09:56
  • Try [(413) Request Entity Too Large | uploadReadAheadSize](https://stackoverflow.com/q/10122957/3805124) It looks like you've made most of the config changes already but there maybe something extra you can try. – PhilS Jan 24 '19 at 10:25
  • @PhilS It still get the same error – Rasistar W'mo Jan 25 '19 at 06:52
  • I'm not sure from your update. If you've got a solution that you think would be valuable for future visitors, please [answer your own question](https://stackoverflow.com/help/self-answer). On the other hand, if you're problem was a simple mistake and unlikely to help future visitors, you might want to consider deleting it instead. Either way, editing it to put `(Solved)` in the title is the wrong way of interacting with the SO site. – Damien_The_Unbeliever Jan 25 '19 at 08:13
  • if the server does not apply the same configuration, it will not take effect. – Abraham Qian Jan 30 '19 at 08:19

0 Answers0