Results 1 to 5 of 5

Thread: [RESOLVED] MaxReceivedMessageSize error

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2005
    Location
    Wisconsin
    Posts
    788

    Resolved [RESOLVED] MaxReceivedMessageSize error

    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.

    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
    Code:
    using SMC = System.ServiceModel.Channels;

    And this is the error
    Code:
    "The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize
    Any help is appreciated.

  2. #2
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Dunmow,Essex,England
    Posts
    898

    Re: MaxReceivedMessageSize error

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

    in code could be something like:

    Code:
    BasicHttpBinding httpBinding = new BasicHttpBinding();
    httpBinding.MaxReceivedMessageSize = 2147483775;
    httpBinding.MaxBufferSize = 2147483775;
    Last edited by Bill Crawley; Nov 16th, 2011 at 11:10 AM.

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2005
    Location
    Wisconsin
    Posts
    788

    Re: MaxReceivedMessageSize error

    Do not have a web.config or app.config file in this project.
    Last edited by mojo69; Nov 16th, 2011 at 12:56 PM.

  4. #4
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Dunmow,Essex,England
    Posts
    898

    Re: MaxReceivedMessageSize error

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

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2005
    Location
    Wisconsin
    Posts
    788

    Re: [RESOLVED] MaxReceivedMessageSize error

    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?

    Code:
      <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>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width