Solution: If you have just started working with WCF applications and are trying to upload small files then you might get rid of this exception, but if you are trying to upload larges files then you might have to face this exception. The solution to this problem is very simple, all you have to do is to follow the steps mentioned below.
- Open you WCF application's Web.config or App.config file.
- Find a node called <system.serviceModel>.
- Inside the <system.serviceModel> nodes create a node <bindings>.
- Then create a node matching the binding you are using. For example <basicHttpBinding></basicHttpBinding> for basicHttpBinding.
- In the last copy and paste the following code: <binding name="basicBinding" maxBufferPoolSize="104857600" maxReceivedMessageSize="5242880">
Note: Change the binding name according to the bindingConfiguration attribute of you endpoint and also change the size(in bytes) as per you requirement.
Example:
<system.serviceModel>
<bindings>
<wsDualHttpBinding>
<binding name="DualBinding" maxBufferPoolSize="104857600" maxReceivedMessageSize="5242880">
</binding>
</wsDualHttpBinding>
</bindings>
</system.serviceModel>
No comments:
Post a Comment