none
File sync error with WCF RRS feed

  • Question

  • We are trying to implement remote filesync and was working fine in CTP1 when we upgraded to CTP2 the following error occurs


    {"The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://ektron.com/filesyncserviceTongue TiedourceChanges. The InnerException message was 'There was an error deserializing the object of type Microsoft.Synchronization.ChangeBatch. Xml representation of the object is invalid.'.  Please see InnerException for more details."}
    Monday, March 10, 2008 6:11 PM

Answers

All replies

  • Ok simplified the issue to just ChangeBatch, it seems like ChangeBatch is no longer serializable over web even when it is marked as serializable. I have one simple method

     

    ChangeBatch GetChanges(ChangeBatch sourceChanges) and my serializer immediately throws the following exception

     

    The service encountered an error.

    An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
    System.InvalidOperationException: An exception was thrown in a call to a WSDL export extension: System.ServiceModel.Description.DataContractSerializerOperationBehavior
     contract: http://ektron.com/filesyncservice:IFileSyncService ----> System.MissingMethodException: No parameterless constructor defined for this object.
       at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)
       at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)
       at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)
       at System.Activator.CreateInstance(Type type, Boolean nonPublic)
       at System.Runtime.Serialization.SchemaExporter.InvokeGetSchemaMethod(Type clrType, XmlSchemaSet schemas, XmlQualifiedName stableName)
       at System.Runtime.Serialization.SchemaExporter.ExportXmlDataContract(XmlDataContract dataContract)
       at System.Runtime.Serialization.SchemaExporter.ExportDataContract(DataContract dataContract)
       at System.Runtime.Serialization.SchemaExporter.Export()
       at System.Runtime.Serialization.XsdDataContractExporter.Export(Type type)
       at System.ServiceModel.Description.MessageContractExporter.ExportType(Type type, String partName, String operationName, XmlSchemaType& xsdType)
       at System.ServiceModel.Description.DataContractSerializerMessageContractExporter.ExportBody(Int32 messageIndex, Object state)
       at System.ServiceModel.Description.MessageContractExporter.ExportMessage(Int32 messageIndex, Object state)
       at System.ServiceModel.Description.MessageContractExporter.ExportMessageContract()
       at System.ServiceModel.Description.DataContractSerializerOperationBehavior.System.ServiceModel.Description.IWsdlExportExtension.ExportContract(WsdlExporter exporter, WsdlContractConversionContext contractContext)
       at System.ServiceModel.Description.WsdlExporter.CallExtension(WsdlContractConversionContext contractContext, IWsdlExportExtension extension)
       --- End of inner ExceptionDetail stack trace ---
       at System.ServiceModel.Description.ServiceMetadataBehavior.MetadataExtensionInitializer.GenerateMetadata()
       at System.ServiceModel.Description.ServiceMetadataExtension.EnsureInitialized()
       at System.ServiceModel.Description.ServiceMetadataExtension.HttpGetImpl.InitializationData.InitializeFrom(ServiceMetadataExtension extension)
       at System.ServiceModel.Description.ServiceMetadataExtension.HttpGetImpl.GetInitData()
       at System.ServiceModel.Description.ServiceMetadataExtension.HttpGetImpl.TryHandleMetadataRequest(Message httpGetRequest, String[] queries, Message& replyMessage)
       at System.ServiceModel.Description.ServiceMetadataExtension.HttpGetImpl.ProcessHttpRequest(Message httpGetRequest)
       at System.ServiceModel.Description.ServiceMetadataExtension.HttpGetImpl.Get(Message message)
       at SyncInvokeGet(Object , Object[] , Object[] )
       at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
       at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
       at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
       at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc& rpc)
       at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc& rpc)
       at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc& rpc)
       at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc& rpc)
       at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
    Monday, March 10, 2008 9:13 PM
  • Where you able to solve your file sync problem with WCF?  I  really need a working sample.  Thanks.


    Kumaran Pandourangan
    Thursday, January 21, 2010 4:21 PM
  • This sample demonstrates how you can use WCF to sync using remote change application, hope this helps:

    http://code.msdn.microsoft.com/sync/Release/ProjectReleases.aspx?ReleaseId=3421
    Monday, March 15, 2010 6:33 PM
    Moderator