locked
SyncServicesForDevices - How to create the Service Reference in the GBADesktopClient project? RRS feed

  • Question

  • Hello,

    I am trying to dive into the MS Sync Framework while studying the GBASyncServicesForDevices example.
    For this reason I created a new Workspace and tried to reconstruct the steps done in the GBASyncServicesForDevices project.

    Now I am having a problem with linking to the created WebServer in the GBADesktopClient project.

    The client project creates a Reference.cs file with an IGBACacheSynContract interface:


      [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
        [System.ServiceModel.ServiceContractAttribute(ConfigurationName="GBAConfiguredSyncWcfService.IGBACacheSyncContract")]
        public interface IGBACacheSyncContract {
           
            [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IGBACacheSyncContract/ApplyChanges", ReplyAction="http://tempuri.org/IGBACacheSyncContract/ApplyChangesResponse")]
            Microsoft.Synchronization.Data.SyncContext ApplyChanges(Microsoft.Synchronization.Data.SyncGroupMetadata groupMetadata, System.Data.DataSet dataSet, Microsoft.Synchronization.Data.SyncSession syncSession);
           
            [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IGBACacheSyncContract/GetChanges", ReplyAction="http://tempuri.org/IGBACacheSyncContract/GetChangesResponse")]
            Microsoft.Synchronization.Data.SyncContext GetChanges(Microsoft.Synchronization.Data.SyncGroupMetadata groupMetadata, Microsoft.Synchronization.Data.SyncSession syncSession);
           
            [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IGBACacheSyncContract/GetSchema", ReplyAction="http://tempuri.org/IGBACacheSyncContract/GetSchemaResponse")]
            Microsoft.Synchronization.Data.SyncSchema GetSchema(string[] tableNames, Microsoft.Synchronization.Data.SyncSession syncSession);
           
            [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IGBACacheSyncContract/GetServerInfo", ReplyAction="http://tempuri.org/IGBACacheSyncContract/GetServerInfoResponse")]
            Microsoft.Synchronization.Data.SyncServerInfo GetServerInfo(Microsoft.Synchronization.Data.SyncSession syncSession);
        }



    my generated file looks like this:

     [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
        [System.ServiceModel.ServiceContractAttribute(Namespace="http://services.
    mydomain.de/", ConfigurationName="EtaskConfiguredSyncWcfService.EtaskServerSyncServiceSoap")]
        public interface EtaskServerSyncServiceSoap {
           
            [System.ServiceModel.OperationContractAttribute(Action="http://services.
    mydomain.de/ApplyChanges", ReplyAction="*")]
            [System.ServiceModel.XmlSerializerFormatAttribute()]
            Etask.Client.Desktop.EtaskConfiguredSyncWcfService.SyncContext ApplyChanges(Etask.Client.Desktop.EtaskConfiguredSyncWcfService.SyncGroupMetadata groupMetadata, System.Data.DataSet dataSet, Etask.Client.Desktop.EtaskConfiguredSyncWcfService.SyncSession syncSession);
           
            [System.ServiceModel.OperationContractAttribute(Action="http://services.
    mydomain.de/GetChanges", ReplyAction="*")]
            [System.ServiceModel.XmlSerializerFormatAttribute()]
            Etask.Client.Desktop.EtaskConfiguredSyncWcfService.SyncContext GetChanges(Etask.Client.Desktop.EtaskConfiguredSyncWcfService.SyncGroupMetadata groupMetadata, Etask.Client.Desktop.EtaskConfiguredSyncWcfService.SyncSession syncSession);
           
            [System.ServiceModel.OperationContractAttribute(Action="http://services.
    mydomain.de/GetSchema", ReplyAction="*")]
            [System.ServiceModel.XmlSerializerFormatAttribute()]
            Etask.Client.Desktop.EtaskConfiguredSyncWcfService.SyncSchema GetSchema(string[] tableNames, Etask.Client.Desktop.EtaskConfiguredSyncWcfService.SyncSession syncSession);
           
            [System.ServiceModel.OperationContractAttribute(Action="http://services.mydomain.de/GetServerInfo", ReplyAction="*")]
            [System.ServiceModel.XmlSerializerFormatAttribute()]
            Etask.Client.Desktop.EtaskConfiguredSyncWcfService.SyncServerInfo GetServerInfo(Etask.Client.Desktop.EtaskConfiguredSyncWcfService.SyncSession syncSession);
        }


    it differs in 3 ways:

    1. my interface is named *Soap instead of something like I*
    CacheSyncContrac. I know... it´s only a name, but does it have a reason?


    2. my defined actions look like "
    Action="http://services.mydomain.de/GetSchema", the original GBADesktopClient reference.cs uses something like "Action="http://services.mydomain.de/IGBACacheSyncContract/GetSchema".


    3. my file does have a wildcard in the ReplyAction, the example does not use a wildcard.


    My general question is .... how was the reference.cs created in the SyncServiceExample? Manually or with a designer,
    if with a designer... what did I do wrong?



    Regards,

    Martin
    • Moved by Hengzhe Li Friday, April 22, 2011 5:59 AM (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Friday, January 23, 2009 4:50 PM

All replies

  • Hi Martin,

    the reference.cs file in the sample was generated with the netcf version of the syncutil.exe( syncutilnetcf.exe), the sync designer in VS 2008 SP1 should use the same method to generate it.

     

    due to a limiation in this tool, some dup object could be generated, you should simply remove them and reference the necessary sync services assemblies to avoid run time errors due to dup objects are defined. the instruction of the sample should have a step by step instruction for this.

     

    hope this helps.

     

    thanks

    Yunwen

    Sunday, January 25, 2009 8:18 AM
    Moderator
  • Hello Yunwen,

    thank you very much!

    What do you mean by: "
    the instruction of the sample should have a step by step instruction for this."?
    The doc-file/readme contaned in the sample project?

    Can you give me a hint which page do you mean
    exactly?



    Regards,

    Martin


    Monday, January 26, 2009 8:21 AM