locked
SYnchronize with WCF Max Received Message Size Restrictions. RRS feed

  • Question

  • I have tried with WCF Synchronization with N-Tier apps. But How do i handle the size restrictions on wcf. I got an Exception. I can maximize the maxReceivedMessageSize to some number. Is there any other way to solve this problem like send it to client by size by size.

     

    Thanks in Advance.

     

     

     

    • Moved by Max Wang_1983 Thursday, April 21, 2011 5:57 PM forum consolidation (From:SyncFx - Technical Discussion [ReadOnly])
    Tuesday, April 22, 2008 8:03 PM

Answers

  • Hi,

     

    You can use the ChangeBatch functionality to limit the size.  On the WCF side, you may also need to edit maxReceivedMessageSize (its default value is 64k which could be too small depending on what you are syncing).

    If you are syncing streams, WCF has also a “Streamed” option available, however we have not tried this and you might need to check more with the WCF docs on how to do this.

     

    Liam

     

     

    Wednesday, April 30, 2008 5:29 PM

All replies

  • Hi,

     

    You can use the ChangeBatch functionality to limit the size.  On the WCF side, you may also need to edit maxReceivedMessageSize (its default value is 64k which could be too small depending on what you are syncing).

    If you are syncing streams, WCF has also a “Streamed” option available, however we have not tried this and you might need to check more with the WCF docs on how to do this.

     

    Liam

     

     

    Wednesday, April 30, 2008 5:29 PM
  • I am running into this error.  I began getting the maxReceivedMessageSize error when I hit 8K.  I reset some parameters and now, when I hit 64K I get a very unhelpful "Bad request" error.

     

    Where is the setting to allow me to raise the default from 64K?

     

    Don

    Wednesday, August 13, 2008 6:29 PM
  • I had to deal with this today.  I am just starting out with WCF, so most of the settings are pure Greek to me.  As such, there could be any number of things wrong with what I'm about to suggest. For one thing, this is all being done in a development environment with all security turned off until I figure out how to do that properly.  This did work for me, though, and got me past the 400 Bad Request error.

     

    On the WCF side, I had an endpoint in my app.config that looked like this:

     

    <endpoint address ="" binding="basicHttpBinding" contract="ServerGateway.IAVFilesSyncSyncContract" />

     

    Under System.ServiceModel I added a specific named basicHttp binding:

     

            <bindings>
                <basicHttpBinding>
                    <binding name="Binding1"
                             maxReceivedMessageSize = "10000000">
                        <security mode="None" />
                    </binding>
                </basicHttpBinding>
            </bindings>

    Note the maxReceivedMessageSize.  In my case I set it to 10,000,000 because I had lots of rows being synchronized.

     

    I then modified the endpoint to look like tihs:

     

    <endpoint address ="" binding="basicHttpBinding" bindingConfiguration="Binding1" contract="ServerGateway.IAVFilesSyncSyncContract" />

     

    Note the new "bindingConfiguration" property I added to refer to the configuration above.

     

    I also had to modify the client side.  The client app's app.config has a section in system.ServiceModel/bindings that starts off something like this:

     

    <basicHttpBinding><binding name="basicHttpBinding_IAVFilesSyncSyncContract"...

     

    I set these two properties in that binding:

     

    maxBufferSize="10000000"

    maxReceivedMessageSize="10000000"

     

    maxBufferSize apparently has to be the same as maxReceivedMessageSize.

     

    At that point I was able to successfully complete my synchronization.

     

    As another side note, I had trouble getting Fiddler to work with this at first.  I got errors about the endpoint when I tried to change my endpoint address on the client side to http://localhost.:8080 (note the period after localhost, which is what I would normally do to get localhost to show up in Fiddler).

     

    I tried changing the host baseAddress to http://orsus:8080... etc. on the server side (where orsus is my machine name), but initially when I tried to use that from the client I got timeout errors.  I am running under Vista, and it turned out that the firewall was preventing that from working.  I disconnected from the internet, turned off my firewall, and was then able to run synchronization and see the request/response in Fiddler successfully.

     

    David

    Tuesday, January 20, 2009 1:36 PM