none
Queries regarding Sync101 over WCF sample

    Question

  • I am trying to achieve the ability to use the Microsoft Sync Framework (MSF) over the Internet and have come across this example that gives the means to achieve this: http : //code.msdn.microsoft  com/Sync101-with-Remote-Change-e1877a3a

    (Please note links have been separated with spaces as my account has not been confirmed by Microsoft yet so I cannot hyperlink.)

    I downloaded and compiled it, and it all appears to function correctly. All the examples behave as commented.

    My issue comes when trying to take this code and make it work across two machines. I have a second computer on the same network hosting the ASP service and I am able to connect to this fine from my computer in chrome (192.168.0.10/service.svc).

    I see that for providerNameB and providerNameC it tries to use the RemoteProviderProxy class rather than the MySyncProvider class, which uses this binding: WSHttpBinding_Sync101WebService.

    I do not understand entirely what needs to be changed in the config in order to connect to another address rather than localhost - I have modified it so that the identity is commented out and the endpoint points to the server:

    <endpoint address="http : //192.168.0.10/service.svc" binding="wsHttpBinding" contract="Sync101WebService.ISync101WebService">
    	<!-- 
    	Upon deployment, the following identity element should be removed or replaced to reflect the 
    	identity under which the deployed service runs.  If removed, WCF will infer an appropriate identity 
    	automatically.
    	-->
    	<!--<identity>
    	<dns value="localhost"/>
    	</identity>-->
    </endpoint>

    And also tried with the endpoint left blank and the identity pointing to the server:

    <endpoint address="" binding="wsHttpBinding" contract="Sync101WebService.ISync101WebService">
    	<!-- 
    	Upon deployment, the following identity element should be removed or replaced to reflect the 
    	identity under which the deployed service runs.  If removed, WCF will infer an appropriate identity 
    	automatically.
    	-->
    	<identity>
    	<dns value="http : //192.168.0.10/service.svc"/>
    	</identity>
    </endpoint>

    The latter produces an error which I do not understand:

    A storage engine operation failed with error code 25035 (HRESULT = 0x80004005, Source IID = {0C733A8B-2A1C-11CE-ADE5-00AA0044773D}, Parameters=(0, 0, 0, \\CUNIM\RedirectedFolders\harrylynas\Desktop\101 Remote WCF Sync\MyTestProgram\bin\Debug\ComputerB.Metadata, , , )).
    on line:
    _metadataStore = SqlMetadataStore.OpenStore(_replicaMetadataFile);
    Line: 88, MySimpleProvider.cs

    The former produces an error saying no response was obtained:

    Security negotiation failed because the remote party did not send back a reply in a timely manner. This may be because the underlying transport connection was aborted.

    Neither error I have been able to fix.

    Furthermore I am not confident on the logic behind how to achieve this synchronisation:

    • How does each computer know which files are changed? With the standard MSF there is an event listener that stores within a manifest, would this need to be implemented into this project?
    • The files are being stored inside a .store file, with GUID (GUID), Data (String) (Name?), and a value (String). To synchronise directories it should be storing raw files for each item, or do I need to implement functionality for this?
    • This comment:
    //Initialize the stores
    // We create all the stores on the same machine in this sample app. However we will
    // sync with B and C using the remote change application pattern over WCF as if they 
    // were on a remote machine.
    // For a real deployment, B and C would be created on remote machines.
    MySimpleDataStore storeA = MySimpleDataStore.ReadStoreFromFile(folderPathForDataAndMetadata, providerNameA);
    MySimpleDataStore storeB = MySimpleDataStore.ReadStoreFromFile(folderPathForDataAndMetadata, providerNameB);
    MySimpleDataStore storeC = MySimpleDataStore.ReadStoreFromFile(folderPathForDataAndMetadata, providerNameC);

    It mentions that B and C would be stored on remote machines, but how? How does this program load the stores from the other machines in order to determine what files need to be synchronised? I am very much lost by all this code and there are comments assuming you understand how to implement such functionality throughout this example.

    Thanks,

    Harry



    • Edited by HarryLy Tuesday, November 19, 2013 5:08 PM
    Tuesday, November 19, 2013 5:07 PM

All replies

  • the metadata store does not store the files themselves, but just metadata required to record what has changed or what has been synched.

    if you deployed the service on a separate machine, are you sure the path you specified for the metadata is correct and accessible by that machine?

    Tuesday, November 19, 2013 6:37 PM
  • the metadata store does not store the files themselves, but just metadata required to record what has changed or what has been synched.

    if you deployed the service on a separate machine, are you sure the path you specified for the metadata is correct and accessible by that machine?

    Can you confirm how I specify the path for the metadata? At the moment I left everything in the runtime directory and am only changing the web config as when machine B and C is passed into the functions it handles them and returns a proxy of that configuration, which I have assumed is how you point to another machine.

    Wednesday, November 20, 2013 10:15 AM
  • in your code above,  what's the value for folderPathForDataAndMetadata?

    that't the metadata path

    the value you modified on the config is to point where the WCF service is.

    Thursday, November 28, 2013 1:40 AM