locked
Having a hard time RRS feed

  • Question

  •  

    Im having a really hard time grasping this framework. What i want to use it for is to download information from a webservice. And put it into my database (sql express). Then at some point in time, the user will change that data, and i need to reupload that data to the webservice (only 2 fields of the like 20 taht it downloads). Now the webservice doesnt really have any change tracking. It allows me to retrieve new/changed info from a specific datetime though (up to 30 days).

     

    Is the sync framework a good candidate for this type of thing? The data is in completely different formats on the webserive and the database. How do i store the metadata for the webservice?

     

     

     

     

     

    Friday, August 29, 2008 4:16 AM

Answers

  • Given the limited support from the web service you will definitely need to do a little more work to enable this scenario. 

     

    The first question you need to ask is whether or not there is any possibility for the clients to communicate directly.  If there is then you will need to find some place to store the service metadata that is accessible by all clients.  That could be in the web service itself or somewhere else on the internet.  If the clients won’t ever communicate directly then the task is a little bit easier because you can just store, client specific, server metadata on each client.  At that point you could use the Sync Framework’s metadata store to keep the metadata. 

     

    The next question is then how you would go about change detection.  You note in your post that the web service will give you changes based on a date/time.  Is it possible to have deletions in your scenario?  If so, then will the web service also tell you about deletions based on the date/time?  If the answer to both of these questions is yes and the clock for the web service is reasonably reliable (i.e. it never goes backwards and will always return the same set of changes for a given date/time) then you can use it to detect changes.  Otherwise you will need to use the technique of enumerating the contents of the web service and comparing that to stored information (kept in the metadata store) to detect changes.  We have some samples for using the metadata store that I recommend you look at because I think they should shed some light on how to use it for similar scenarios.

     

    Once you have those problems for your web service, the Sync Framework can help take care of the rest by for instance helping to detect conflicts and figure out what changes need to be pushed up to the service.

     

    Regards,

     

    Michael Clark

    Development Manager

    Microsoft Sync Framework

     

     

    Tuesday, September 2, 2008 7:50 PM
    Moderator

All replies

  • Given the limited support from the web service you will definitely need to do a little more work to enable this scenario. 

     

    The first question you need to ask is whether or not there is any possibility for the clients to communicate directly.  If there is then you will need to find some place to store the service metadata that is accessible by all clients.  That could be in the web service itself or somewhere else on the internet.  If the clients won’t ever communicate directly then the task is a little bit easier because you can just store, client specific, server metadata on each client.  At that point you could use the Sync Framework’s metadata store to keep the metadata. 

     

    The next question is then how you would go about change detection.  You note in your post that the web service will give you changes based on a date/time.  Is it possible to have deletions in your scenario?  If so, then will the web service also tell you about deletions based on the date/time?  If the answer to both of these questions is yes and the clock for the web service is reasonably reliable (i.e. it never goes backwards and will always return the same set of changes for a given date/time) then you can use it to detect changes.  Otherwise you will need to use the technique of enumerating the contents of the web service and comparing that to stored information (kept in the metadata store) to detect changes.  We have some samples for using the metadata store that I recommend you look at because I think they should shed some light on how to use it for similar scenarios.

     

    Once you have those problems for your web service, the Sync Framework can help take care of the rest by for instance helping to detect conflicts and figure out what changes need to be pushed up to the service.

     

    Regards,

     

    Michael Clark

    Development Manager

    Microsoft Sync Framework

     

     

    Tuesday, September 2, 2008 7:50 PM
    Moderator
  •  

    Well nothign actually gets deleted by the user. Data the webservice is only available for up to 4 months. After that its automatically removed. As for deletes on the client end, well there really wont be any deletes per say. But data older then 2 years will be moved off to a different db for archive.

     

    I actually have spent about a week trying to learn the framework. And while i think i grasp all the concepts in the intro docs, i cant open all the examples as i only have vs2005 and odn thave the funds to upgrade to 2008. I have stepped through the examples i can open though..

     

    I would like to store all teh metadata in the same db as my client data, rather then have external files to try and keep track of. My problem is trying to figure out where to store knowledge. Should i jsut serialize it and store it in a record in the db?

     

    Thursday, September 4, 2008 4:46 PM