none
Using Sync framework 2.1 in Mobile device RRS feed

  • General discussion

  • Hi,
    Can I use sync Framework 2.1 in mobile device having windows mobile 6.5. I need to sync the device database (SQL CE 3.5) with SQL Azure. The source and destination tables have different name and schema.

    Thanks in advance.

    Regards
    Kakali


    raich
    Thursday, December 15, 2011 6:39 AM

All replies

  • afaik, the provider that works with win mobile is the still the old v1 drivers. you might want to check out using the Sync Toolkit as well.
    Thursday, December 15, 2011 12:59 PM
    Moderator
  • Well,

    I have moved the logic to Server side (WCF running in Windows Azure) so from client I am sending only a connection. But WCF seems not finding the mobile device database for sync.

    Any idea what could be wrong.

    Thanks & Regards

    Kakali Gupta


    raich
    Wednesday, December 21, 2011 9:37 AM
  • are you trying to get your WCF service to connect to your mobile device?
    Thursday, December 22, 2011 5:50 AM
    Moderator
  • Actually, yes. Is it not possible?

    Is there any way I can do it, like using Duplex channel?

    Thanks & Regards

    Kakali Gupta


    raich
    Thursday, December 22, 2011 6:41 AM
  • Hi,

    I was trying to use sync framework 2.0 which is supported by Mobile device. But I am not able to to deploy it in Azure as I think Sync framework 2.0 does not support private assembly deployment. Anybody can confirm it?

    Thanks & Regards

    Kakali Gupta


    raich
    Tuesday, December 27, 2011 11:23 AM
  • Hi,

    Well, I have used sync toolkit and able to sync btween Mobile CE and SQL Azure. Now I have another issue, I have one table in server (SQL Azure) which is synchronized to two different tables in Client (Mobile) based on some filteration condition. Is it possible. I tried adding the same table with different global name in config, but seems the service picks up the last one found, overwriting basically.

    Please advise.

    Thanks & Regards

    Kakali Gupta


    raich
    Wednesday, January 11, 2012 11:32 AM
  • why not create two different scopes for you client?
    Wednesday, January 11, 2012 11:38 AM
    Moderator
  • Thanks JuneT,

    I have done this. Now in my scenario, some entities are only for download and some for upload. As Sync Toolkit does not support download only or upload only scenario, I have created separate scopes for download and upload. For upload I have no issue as in service inside Upload_request, I am checking the type of entity and calling context.RejectChanges for specific entities.

    But I could not find anything similar inside Download_Request. So for download, in OnDownloadGetResponseCompleted of HttpCacheRequestHandler, I have created removed the entities not for download from the knowntype collection, actually created a new collection and used here:

    // Create the SyncReader

     

    this._syncReader = (base

    .SerializationFormat == ClientServices.SerializationFormat.ODataAtom)

    ? (SyncReader)

    new ODataAtomReader(responseStream, this

    ._knownTypes)

    : (SyncReader)

    new ODataJsonReader(responseStream, this

    ._knownTypes);

    But after that Upload is not working I am getting 404 error.  I have used Fidller to see the exact error, which turned out to be "Scope does not exists". But I can see the scope in browser with $SyncScopes and the server database is rightly provisioned.  Could you help me out on this?

    Thanks & Regards

    Kakali Gupta


    raich
    Tuesday, January 17, 2012 4:30 AM
  • to control Upload or Download, i think you can alter the CacheController if you want. by default it's doing an UploadAndDownload.

    If there are changes to upload, it will submit an Upload request, otherwise it will submit a Download request. If an Upload request is made, the Download request is submitted after the Upload request is done.

    Tuesday, January 17, 2012 10:24 AM
    Moderator
  • Thanks JuneT,

    I have tried to alter CacheController. Yes it first check for upload, but it checks in a client database table _sync for the last downloaded server blob (anchor). And as the last downloaded one is of different scope while upload it gives error. I tried to send an empty blob that also fails as in server side it checks the same (in ApplyChanges of SQLSyncProviderService).

    Should I remove the extra scope for upload then how do I filtered out the download only entities as it will try to download all added in cachecontroller's control behaviour.

    Thanks & Regards

    Kakali Gupta

     


    raich
    Tuesday, January 17, 2012 10:41 AM