locked
Sync, Image and Windows Mobile RRS feed

  • Question

  •  

    I Sync a Sql Server Compact 3.5 Sp1 on a device with WCF

     

    I applied method shown on this post http://forums.microsoft.com/sync/ShowPost.aspx?PostID=3609978&SiteID=75 and all works fine.

     

    But now i want to add Images, (small images) but my Synchronization didin't work...

     

    Someone has already tested and checked this beahavior  ?

    • Moved by Tina_Tian Friday, April 22, 2011 8:07 AM (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Tuesday, September 30, 2008 9:18 PM

Answers

  •  

    I solved my problem

     

    The message size can't execeed int.MaxValue

     

    so here is the code snippet

     

    Code Snippet

    public static System.ServiceModel.Channels.Binding CreateDefaultBinding()

    {

    System.ServiceModel.Channels.CustomBinding binding = new System.ServiceModel.Channels.CustomBinding();

    binding.Elements.Add(new System.ServiceModel.Channels.TextMessageEncodingBindingElement(System.ServiceModel.Channels.MessageVersion.Soap11, System.Text.Encoding.UTF8));

     

    System.ServiceModel.Channels.HttpTransportBindingElement httpBindingEl = new System.ServiceModel.Channels.HttpTransportBindingElement();

     

    httpBindingEl.MaxReceivedMessageSize = (long)int.MaxValue;

    httpBindingEl.MaxBufferPoolSize = (long)int..MaxValue;

    httpBindingEl.MaxBufferSize = int.MaxValue;

     

    return binding;

    }

     

     

    Monday, October 6, 2008 8:49 AM

All replies

  •  

    Well, with a very very small image, all work fine..

    The problem is probably from my basichttpbinding. I can configure it on server, it's just simple WCF configuration

     

    But where can i configure the large quota on my Device application ? I dont know where put this information.

    The NetCfSvcUtil generate a very large code file CFClientBase.cs, i think it's somewhere in this generated file perhaps ?

     

    Or maybe a config file to add ? (well, i think it's not the correct solution Smile)

    Tuesday, September 30, 2008 10:38 PM
  •  

    I tried to modify mu generated file like this :

     

     

    Code Snippet

    public static System.ServiceModel.Channels.Binding CreateDefaultBinding()

    {

    System.ServiceModel.Channels.CustomBinding binding = new System.ServiceModel.Channels.CustomBinding();

    binding.Elements.Add(new System.ServiceModel.Channels.TextMessageEncodingBindingElement(System.ServiceModel.Channels.MessageVersion.Soap11, System.Text.Encoding.UTF8));

    System.ServiceModel.Channels.HttpTransportBindingElement httpBindingEl = new System.ServiceModel.Channels.HttpTransportBindingElement();

    httpBindingEl.MaxReceivedMessageSize = long.MaxValue;

    httpBindingEl.MaxBufferPoolSize = long.MaxValue;

    httpBindingEl.MaxBufferSize = int.MaxValue;

    return binding;

    }

     

     

    But it doesn't work Smile
    Wednesday, October 1, 2008 7:34 AM
  •  

    I really need some help, any idea ?
    Friday, October 3, 2008 9:59 AM
  •  

    I solved my problem

     

    The message size can't execeed int.MaxValue

     

    so here is the code snippet

     

    Code Snippet

    public static System.ServiceModel.Channels.Binding CreateDefaultBinding()

    {

    System.ServiceModel.Channels.CustomBinding binding = new System.ServiceModel.Channels.CustomBinding();

    binding.Elements.Add(new System.ServiceModel.Channels.TextMessageEncodingBindingElement(System.ServiceModel.Channels.MessageVersion.Soap11, System.Text.Encoding.UTF8));

     

    System.ServiceModel.Channels.HttpTransportBindingElement httpBindingEl = new System.ServiceModel.Channels.HttpTransportBindingElement();

     

    httpBindingEl.MaxReceivedMessageSize = (long)int.MaxValue;

    httpBindingEl.MaxBufferPoolSize = (long)int..MaxValue;

    httpBindingEl.MaxBufferSize = int.MaxValue;

     

    return binding;

    }

     

     

    Monday, October 6, 2008 8:49 AM