locked
Examples on how to use Sync Framework to Sync SQL DB with WebServices RRS feed

  • Question

  • Can any one guide me with an example how to use this great framework with webservices, please?  I have SQL Server 2008, which is exposing the data to BlackBerry devices through webservices using regular web methods. But, what I heard is I could make use of Sync Framework to expose data through Web Services and to save it back to the database. 

    So, is there any step by step instructions on how to do that, please? 
    vincy
    Tuesday, February 23, 2010 12:11 PM

Answers

  • hi vincy,

    Sync Framework is used for synchronizing copies of data but not for exposing data via Web Services. Are you looking at synching your SQL 2008 with another database? Or are you looking at exposing via web services so applications can consume the data and update it? If it's the latter, you might want to look at WCF Data Services instead (http://msdn.microsoft.com/en-us/data/bb931106.aspx)

    hth,

    junet
    • Marked as answer by Yunwen Bai Wednesday, February 24, 2010 7:32 AM
    Tuesday, February 23, 2010 2:42 PM

All replies

  • hi vincy,

    Sync Framework is used for synchronizing copies of data but not for exposing data via Web Services. Are you looking at synching your SQL 2008 with another database? Or are you looking at exposing via web services so applications can consume the data and update it? If it's the latter, you might want to look at WCF Data Services instead (http://msdn.microsoft.com/en-us/data/bb931106.aspx)

    hth,

    junet
    • Marked as answer by Yunwen Bai Wednesday, February 24, 2010 7:32 AM
    Tuesday, February 23, 2010 2:42 PM
  • Just one comment on the client side. please be aware that the BlackBerry is not an supported devices if you choose to use sync services for ado.net for devices (http://www.microsoft.com/downloads/details.aspx?familyid=75FEF59F-1B5E-49BC-A21A-9EF4F34DE6FC&displaylang=en ).

    thanks
    Yunwen
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Wednesday, February 24, 2010 7:32 AM
  • Thanks Junet for your quick response.

    When I read this article http://msdn.microsoft.com/en-us/sync/bb887608.aspx under the "Database Synchronization and the Microsoft Sync Framework" section it states as follows:

    "Sync Framework database synchronization providers enable synchronization between ADO.NET-enabled databases. Since the database synchronization providers are part of the Sync Framework, any database that uses these providers can then also exchange information with other data sources that are supported by Sync Framework, such as web services, file systems, or custom data stores."

    This is what I am trying to accomplish, meaning using the ADP.Net I need to expose the data which I am currently doing.

    Let me explain what I am doing here.  We have mobile devices, SQL Server 2008 database and Web Services in between them.  We also have web based application which is talking to the same database.  What my web service do is, exposing data to the mobile devices and gets the data back from them.

    So, when my web service receives the data back from the mobile devices, I should be able to feed that data back into ADO.Net, which would automatically do the rest of the job for me based on the conflict resolution set. 

    Is this possible using the Sync Framework or am I missing something from the above statement.  Just wanted to clarify.

    Thanks,
    vincy
    Wednesday, February 24, 2010 4:59 PM
  • Thank you Yunwen.  Yes, I know ado.net does not support BlackBerry devices and supports only windows Mobile.  That is why we went on Web Services route.  But came across with this above statement and thought there might be something that we can leverage for our purpose.  So, just curious.
    vincy
    Wednesday, February 24, 2010 5:03 PM
  • Hi Vincy, 

    i dont think there is web service provider out of the box in SyncFx, there is a Web feed synchronization though : http://msdn.microsoft.com/en-us/library/bb902825(SQL.105).aspx.

    if you're after the conflict resolution features, then another route you may want to look at is on your web service, you may save the data submitted via Web Service to a another DB (SQL Compact or SQL Express or maybe to your existing SQL 2008), then do the sync between this temporary database and your main SQL 2008 database.

    in effect (pardon my skills in doing diagrams :) )

    BlackBerry -> Web Service -> TempDB - SyncFx - SQL 2008 main DB

    Thursday, February 25, 2010 1:39 AM
  • Hi Vincy, 

    i dont think there is web service provider out of the box in SyncFx, there is a Web feed synchronization though : http://msdn.microsoft.com/en-us/library/bb902825(SQL.105).aspx.

    if you're after the conflict resolution features, then another route you may want to look at is on your web service, you may save the data submitted via Web Service to a another DB (SQL Compact or SQL Express or maybe to your existing SQL 2008), then do the sync between this temporary database and your main SQL 2008 database.

    in effect (pardon my skills in doing diagrams :) )

    BlackBerry -> Web Service -> TempDB - SyncFx - SQL 2008 main DB


    It's very valuable, Thanks for your explanation!
    Monday, October 25, 2010 2:24 AM