# .NET and More > WPF, WCF, WF >  [RESOLVED] MaxReceivedMessageSize error

## mojo69

REceiving this error when trying to bring some customer data over from the server. I have changed the MaxReceivedMessageSize on the server side. I need to know how to do it on the client in the code. Here is my binding code.



```
            SMC.Binding binding = VServerClient.CreateDefaultBinding();
            String remoteAddress = VServerClient.EndpointAddress.Uri.ToString();
            remoteAddress = remoteAddress.Replace("localhost", strIP);
            EndpointAddress endpoint = new EndpointAddress(remoteAddress);

            VServerClient client = new VServerClient(binding, endpoint);
```

I have this at the top of the code


```
using SMC = System.ServiceModel.Channels;
```


And this is the error


```
"The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize
```

Any help is appreciated.

----------


## Bill Crawley

This will probably exist in the webConfig file of the client code.

in code could be something like:



```
BasicHttpBinding httpBinding = new BasicHttpBinding();
httpBinding.MaxReceivedMessageSize = 2147483775;
httpBinding.MaxBufferSize = 2147483775;
```

----------


## mojo69

Do not have a web.config or app.config file in this project.

----------


## Bill Crawley

check out my code example. You should have these on your binding object.

----------


## mojo69

I have this in the app.config file for the server side of the project. I am setting the maxReceivedMessageSize here. When I run the client I am still getting the message about the size is too big at 65536. The client is a mobile device running CE, does this prevent the seting from taking effect?



```
  <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="NewBinding0" maxBufferSize="10485760" maxReceivedMessageSize="10485760" />
      </basicHttpBinding>
    </bindings>
    <services>
      <service behaviorConfiguration="VServerServiceWcf.VServerBehavior" name="VServerServiceWcf.VServer">
        <endpoint address="" binding="basicHttpBinding" contract="VServerServiceWcf.IVServer">
          <identity>
            <dns value="localhost" />
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:4910/Design_Time_Addresses/VServerServiceWcf/VServer/" />
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="VServerServiceWcf.VServerBehavior">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
```

----------

