0
votes

I want upload photo by WCF service that is located in IIS server. but I receive "Request Entity too large error 413".

I have changed UploadReadaheadsize value in configuration editor and maxReceivedMessageSize in web.config , but this is not solved my problem.

In while , when i running service in visual studio upload photo does success.

Can anybody help me?

1

1 Answers

0
votes

Add this code to app.config.

<bindings>
  <webHttpBinding >
    <binding name="Binding"     maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" transferMode="Streamed">
      <!--<security mode="Transport">
        <transport clientCredentialType="None" />
      </security>-->
    </binding>
    <binding name="httpbind" crossDomainScriptAccessEnabled="true" maxReceivedMessageSize="10485760">
    </binding>
  </webHttpBinding>
  <basicHttpBinding>
    <binding maxReceivedMessageSize="10485760">
      <!--<readerQuotas ...="" />-->
    </binding>
  </basicHttpBinding>
</bindings>

and remember add in service tag the below code.

<endpoint behaviorConfiguration="web" binding="webHttpBinding" bindingConfiguration="Binding" name="Android" contract="com.Order.Service.IService" />