locked
ItemChange class is not serializable RRS feed

  • Question

  •   I have tried with File WCF Synchronization with N-Tier apps. But the ItemChange class is not serializable. In my RemoteProviderProxy Class, will Implemente the TryGetDestinationVersion(ItemChange sourceChange,out ItemChange destinationVersion)

     

    wcf client code:

     

     public bool TryGetDestinationVersion(ItemChange sourceChange,out ItemChange destinationVersion){

        return this.wcfclient.TryGetDestinationVersion(sourceChange,destinationVersion);

    }

     

     

    wcf server code:

     

    FileProvider provider;

     public bool TryGetDestinationVersion(ItemChange sourceChange,out ItemChange destinationVersion){

        return provider.TryGetDestinationVersion(sourceChange,destinationVersion);

    }

     

    or TryGetDestinationVersion is called by the ProcessChangeBatch().

     in the ProcessChangeBatch()

     

     /*********
                changeApplier.ApplyChanges(resolutionPolicy, sourceChanges,
                    dataRetriever as IChangeDataRetriever, localVersions,
                    myKnowledge.Clone(),
                    destinationForgottenKnowledge, this, currentSessionContext, callbackProxy);

    ***********/

     

    i cannot get the localVersions on the wcf client,so i use other  changeApplier.ApplyChanges

     /*********
                changeApplier.ApplyChanges(resolutionPolicy, sourceChanges,
                    dataRetriever as IChangeDataRetriever, /*localVersions,*/
                    myKnowledge.Clone(),
                    destinationForgottenKnowledge, this, currentSessionContext, callbackProxy);

    ***********/

    but it will call TryGetDestinationVersion.

     

     

    1.how to get localVersions in the wcf client

      or

    2.how to serialize ItemChange

     

    thanks.

                                          

    • Moved by Max Wang_1983 Thursday, April 21, 2011 6:11 PM forum consolidation (From:SyncFx - Technical Discussion [ReadOnly])
    Tuesday, September 30, 2008 4:39 PM

All replies

  • I'm developing a FileSync applincation by the 1.0 Sync101RCA_Cached sample 、ManagedNTFSSample and  WCF and the Sync Framework (Bryan Likes)  . but the  System.IO.Stream is not serializable.  

     

    wcf server code:

     

      public virtual void SaveItemChange(SaveChangeAction saveAction, ItemChange change, SaveChangeContext saveChangeContext)
            {
                // Extract the item change.
                // Note: Since our provider doesn't use CU, it is guaranteed that only one
                // change type will be present on the SaveChangeContext.

                // Extract the data from the change.
                TransferMechanism data = saveChangeContext.ChangeData as TransferMechanism;

                ...

          }

      So i moved the SaveItemChange to the client RemoteProviderProxy Class.

    Tuesday, September 30, 2008 5:00 PM