Sending large file (>10 MB) through WCF rest service - wcf

Previously I am sending file (less than 63 KB ) through WCF Rest service then it send successfully but when the file size is greater than 65 KB, it throws an exception. After that I configure the web.config file like below and it works fine.
<bindings>
<webHttpBinding>
<binding maxReceivedMessageSize="10485760">
<readerQuotas/>
</binding>
</webHttpBinding>
</bindings>
Now i am sending 10 MB file and also increase the size in web.config file but got the same exception.
I added below configuration setting :
<bindings>
<webHttpBinding>
<binding maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" maxBufferPoolSize="2147483647" >
<readerQuotas maxStringContentLength="525288"></readerQuotas>
</binding>
</webHttpBinding>
</bindings>
What is needed to fix this?

I guess you receive this error on client side. remember you have to set the max size at client side!!!
Read Derek's answer. Thats really helpfull.

Related

The maximum message size quota for incoming messages (65536) has been exceeded - set maxReceivedMessageSize="2147483647" updated but not working

added maximum size on web config, but still showing the same error.
ERROR IMAGE
You need to set maxReceivedMessageSize both in your server-side and client-side. The code like this:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding maxBufferSize="64000000" maxReceivedMessageSize="2147483647" />
</basicHttpBinding>
</bindings>
</system.serviceModel>

Message size quota exceeded on WCF netTcpBinding in remote machine

Always getting exception "The maximum message size quota for incoming messages has been exceeded for the remote channel. See the server logs for more details", in .net c# wcf windows application development.
Up to approximate 72kb size data in DataTable I am able to send remote machine hosting WCF in windows service successfully. But above that throwing exception "The maximum message size quota for incoming messages has been exceeded for the remote channel. See the server logs for more details".
Already did setup of data size management both end.
Client-end App.config:
<bindings>
<netTcpBinding>
<binding name="NetTcpBinding_IProjectService"
maxBufferSize="2147483647" maxBufferPoolSize="524288"
maxReceivedMessageSize="2147483647">
<readerQuotas maxStringContentLength="2147483647"/>
</binding>
</netTcpBinding>
</bindings>
Remote server-end App.config:
<netTcpBinding>
<binding name="NetTcpBinding_IProjectService" maxBufferSize="2097152"
maxBufferPoolSize="2097152"maxReceivedMessageSize="2097152">
<readerQuotas maxStringContentLength="2097152" />
</binding>
</netTcpBinding>
Also tried same sizes i.e."2147483647" both-end but with same exception always.
Please consider the below configuration.
<bindings>
<netHttpBinding>
<binding name="mybinding" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
<readerQuotas maxArrayLength="2147483647" maxStringContentLength="2147483647"/>
</binding>
</netHttpBinding>
</bindings>
Moreover, please apply the configuration in the service endpoint by using BindingConfiguration name.
<services>
<service name="sv">
<endpoint bindingConfiguration="mybinding" address="" binding="netTcpBinding" contract="isv" ></endpoint>
</service>
</services>
Please apply the configuration on both the serve-end and the client-end.
Feel free to let me know if the problem still exists.

timeout error from windows workflow

When i call an recevive activity in Workflow, it is showing timeout error after 1 minute.
I tried to increase the timeout by modifying the web.config as follows, but no use.
<bindings>
<basicHttpBinding>
<binding name="longTimeoutBinding" closeTimeout="10:01:00" openTimeout="10:01:00" maxReceivedMessageSize="2147483647"
maxBufferSize="2147483647" maxBufferPoolSize="2147483647" receiveTimeout="10:10:00" sendTimeout="10:10:00" >
<security mode="None" />
</binding>
</basicHttpBinding>
</bindings>
I have similar problem with one of WCF service also when it fectes large number of data.
Can anyone help me to find out what i am missing here.
Have you also set these values on the client side? It could be that the client gives up waiting for a reply.
Could you try and reduce the timeout to 15 seconds to verify that these configs are the ones that are used.
Could you also post the exception that you get

WCF REST Service Template 4.0 "Bad Request"

I am trying to send a large json string to a WCF Service created with the WCF REST Service Template. If the string is longer 8000 characters I get a "HTTP/1.1 400 Bad Request" error. I have tried added this to my web config:
<bindings>
<webHttpBinding>
<binding name="httpBinding" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"/>
</webHttpBinding>
</bindings>
Any ideas?
You must also setup readerQuotas if you want to pass large strings:
<bindings>
<webHttpBinding>
<binding name="httpBinding" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
<readerQuotas maxStringContentLength="50000" />
</binding>
</webHttpBinding>
</bindings>

WCF Streaming not working at server

I have used WCF service to transfer large files in chunks to the server
for that i have reference this article http://kjellsj.blogspot.com/2007/02/wcf-streaming-upload-files-over-http.html
I have configured my application on IIS on my machine. Its work fine here. It allows upto 64mb file upload. But when we have published the site. It allows only maximum 30Mb file if i try to upload more than that i got error 404 - resource not found.
Here is the binding config i have used.
<basicHttpBinding>
<!-- buffer: 64KB; max size: 64MB -->
<binding name="FileTransferServicesBinding" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00" transferMode="Streamed" messageEncoding="Mtom" maxBufferSize="65536" maxReceivedMessageSize="67108864">
<security mode="None">
<transport clientCredentialType="None"/>
</security>
</binding>
</basicHttpBinding>
Please suggest to me if I am missing anything and if required more code please let me know
On your webserver did you adjust the maximum upload size?
Goto "Request Filtering" for the target app, Open the feature, on the right side choose "Edit Feature Settings", in the dialog select a size larger than 30000000 (the default).
If on your local box you were hosting in Cassini, or your local box had different limits this might occur.