locked
SyncSession with Web Service in CTP1 RRS feed

  • Question

  • I'm refactoring my sync code to use a web service and am getting the following exception on the Agent.Synchronize() call:

     

    "Object of type 'Microsoft.Synchronization.Data.Common.SyncSession' cannot be converted to type 'SyncServicesPOC.SyncWebServiceProxy.SyncSession'."

     

    I've implemented the four web methods as in Beta 2; each of them take a SyncSession as an argument. I am doing nothing explicitly with SyncSession in my client.

     

    Dave Michel

     

    • Moved by Max Wang_1983 Friday, April 22, 2011 9:45 PM forum consolidation (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Thursday, November 15, 2007 9:41 PM

Answers

  • Hi Dave,

     

    you got this exception because the references.cs file generated when you add the web reference contains the types that is already defined in the synchronization service assemblies. in order to fix this, you will need to remove the duplicated types in the references.cs file and use the one from the sync services.

     

    Hope this helps.

     

    Thanks

    Yunwen

    Friday, November 16, 2007 12:29 AM
    Moderator

All replies

  • Hi Dave,

     

    you got this exception because the references.cs file generated when you add the web reference contains the types that is already defined in the synchronization service assemblies. in order to fix this, you will need to remove the duplicated types in the references.cs file and use the one from the sync services.

     

    Hope this helps.

     

    Thanks

    Yunwen

    Friday, November 16, 2007 12:29 AM
    Moderator
  • Thanks, Yunwen. You're right - for some reason, the proxy generated was based on the client instead of the server. Seems odd.

     

    In any case, I'm almost there (I'll start yet another new thread for the next issue ). Thanks.

     

    Dave

     

    Friday, November 16, 2007 4:50 AM