locked
Is there a 101 StandardProvider using WCF example that I can look at? RRS feed

  • Question

  • Wow. This is turning out to be Harder than I thought it was going to be...

    I'm looking at the 101 samples, where all the datastores and providers are on the Client console app, trying to see how this would be extended to a scenario where the client and server communicate using WCF.

    Is there a Simple or Standard Provider (not Db based) WCF sample that is publicy available to look at that will help me envision how to set up a WCF service based solution?

    Thanks,
    Sky

    Sunday, March 14, 2010 1:07 AM

Answers

  • Hi Sky,

    Did installing both x86 and x64 versions of the Sync Framework on both machines not resolve your problem? Did you install all our MSIs?

    A couple examples of in-proc are the file system provider, and in windows 7, used for device sync. Also, our simple provider model (new for v2) enables you to only take care of the data transfer part over remote scenarios, you don't have to shuttle change batches anymore.

    The ItemData class used in the sample is a simple Dictionary type - your actual data type may vary and you can choose to have a proxy instead of using the same time. The main sync framwork object that needs to be serialized and deserialized is the ChangeBatch object.

    There is a more detailed walk-through here:

    http://msdn.microsoft.com/en-us/library/ee819079.aspx

    This pattern should work beyond the sample, your actual data transfer mechanism will differ though.
    Tuesday, March 16, 2010 6:15 PM

All replies

  • I think that I've found it: the Sync101RCAoverWCF example available at: https://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=sync&ReleaseId=3421

    Clarification:
    What I don't understand clearly is why the first 101 example available on http://code.msdn.microsoft.com/sync didn't tackle communicating across tiers via WCF immediately -- rather than putting it off to the last example...  Wouldn't 95% single case of syncronisation between applications be across tiers, using WCF?

    Doesn't work:
    That said...the example doesn't work on x64...run into an error on
    "Retrieving the COM class factory for component with CLSID {DBFD020B-D830-4FBE-A927-566B1F57A17A} failed due to the following error: 80040154."
    I think this means I have to scrap my x64 install and redownload the x86 version of SyncFx. I'm off to try that now...
    Sunday, March 14, 2010 2:49 AM
  • Hope you resolve your problem - you just need to deply the right proc version.

    The first example doesn't use WCF, so you can focus on the sync related concepts, and then WCF is added later on so it is easier to understand what differed between the two. A lot of our partners do actually use both providers in-proc, so we think this works fine for most people.
    Monday, March 15, 2010 5:53 PM
  • Hi Sid:

    Unfortunately not...

    You mention that you have a lot of partners use both providers in-proc. Sorry for my ignorance...but what are they using SyncFx for? If both are in proc, I would guess that they can only be syncing in between two local datastores, right? What use cases would one do that?
    Or are you saying that one can have both providers in proc, and yet still sync across a network?!?

    Assuming they need WCF to go across the network, I'll move on to the next part.


    As for the WCF/RCA example:

    I got the first part: it focuses on demonstrating that the Syncing works, and that one has to build an Orchestrator, and instantiate both providers. which sync the contents of two DataStores.

    The later example, the WCF sample demonstrates that when communication across the wire, the orcherstrator instantiates
    a ServiceProvider which wraps a DataStore which contains DataItems, and
    a RemoteServiceProxy, which wraps a ServiceProxy which invokes a server side Service which wraps a ServiceProvider which wraps a DataStore which contains DataItems.

    My problem with understanding the above scenario is that the above seems to support serialization and derialization only because
    a) the DataItem is exactly the same object (not a DataItem + Proxy of the DataItem)
    b) the ServiceProvider on the client  is the same as the server side's ServiceProvider, both of which are dealing with the same DataStore/DataItem definitions.

    But does same pattern work beyond the sample? 
    For example, I would think that if the client were a CF phone, it could not have a dependency on the same Assembly containing the DataItem as that used by the server.

    What am I missing?

    Thanks for your patience,
    Sky
    Tuesday, March 16, 2010 6:20 AM
  • Hi Sky,

    Did installing both x86 and x64 versions of the Sync Framework on both machines not resolve your problem? Did you install all our MSIs?

    A couple examples of in-proc are the file system provider, and in windows 7, used for device sync. Also, our simple provider model (new for v2) enables you to only take care of the data transfer part over remote scenarios, you don't have to shuttle change batches anymore.

    The ItemData class used in the sample is a simple Dictionary type - your actual data type may vary and you can choose to have a proxy instead of using the same time. The main sync framwork object that needs to be serialized and deserialized is the ChangeBatch object.

    There is a more detailed walk-through here:

    http://msdn.microsoft.com/en-us/library/ee819079.aspx

    This pattern should work beyond the sample, your actual data transfer mechanism will differ though.
    Tuesday, March 16, 2010 6:15 PM