0

WCF Service is returning

The remote server returned an error: (413) Request Entity Too Larg

but data size only 80KB i configured 2GB max size. I tried in stack overflow but still I am facing the same issue.

Configuration:

<service name="HP.VFS.ShoppingcartService.ShoppingCart">
    <endpoint name="SOAPEndPoint" contract="HP.VFS.ShoppingcartService.IShoppingCart" binding="basicHttpBinding" address="soap" />
    <endpoint name="RESTEndPoint" contract="HP.VFS.ShoppingcartService.IShoppingCart" binding="webHttpBinding" address="api" behaviorConfiguration="restbehavior" /> <endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex" />
</service>

<basicHttpBinding>
    <binding name="basicHttpBinding" closeTimeout="10:00:00" receiveTimeout="10:00:00" sendTimeout="10:00:00">
         <readerQuotas maxDepth="2000000" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
    </binding>
    <binding name="soap" closeTimeout="10:00:00" receiveTimeout="10:00:00" sendTimeout="10:00:00" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
        <readerQuotas maxDepth="2000000" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
    </binding>
</basicHttpBinding>

Server Side Interface

[OperationContract(Name = "wstCreateOrder")]
[FaultContract(typeof(ApplicationFault))]
[WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped,UriTemplate = "/wstCreateOrder/OrderInfo")]
string CreateOrder(string OrderInfo);

In client side

Service.CreateOrder(80+ KB string);

I am accessing WCF service for transferring data via SOAP protocol inside MVC4 .Net application. Parameter all are string type. While calling the method if the text size is more than 60 KB it's throwing an error like "The remote server returned an error: (413) Request Entity Too Larg". But in Server configuration based on stackoverflow guidelines i added MAX size for Max message received in Configuration still am facing the same kindly help me.

Kannan
  • 1
  • 2
  • Please edit your quesition to include relevant code and error messages as text, not an image. Images aren't searchable, and can be hard to read on some devices. – Jan Boyer Aug 30 '18 at 15:29
  • Guessing the "not" was a typo and you are still facing the issue – James Z Aug 30 '18 at 16:37
  • Thans for the reply. I updated now kindly update me the solution. @JamesZ still am facing the issue. – Kannan Aug 31 '18 at 03:23

1 Answers1

0

Thanks for all. finally i got the solution. solution is just increasing the size for maxDepth "2000000" to "2147483647" problem solved.

Kannan
  • 1
  • 2