none
Databases Synchronisation Using Microsoft Sync Framework. RRS feed

  • Question

  • Hi,           

    I am trying to build a pocket pc application that would synchronise the database on the device with the database on a server using WCF Service Library that I would add as a Web Reference to the SmartDevice Project. I wrote a first prototype with a database having a single table and it worked fine. But when I add more tables I get the following “TargetInvocationException”.

    I am using Visual Studio 2008, SQL Server 2008 R2 SP1 and SQL Server CE 3.5 Sp1 for Device.

    Can anyone help?

    Thanks Eric

    These are the different messages that I get form that exception:

    Exception:  TargetInvocationException

    Stack Trace:

    StackTrace          "   at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean verifyAccess, StackCrawlMark& stackMark)\r\n   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)\r\n   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)\r\n   at Microsoft.Synchronization.Data.ServerSyncProviderProxy.GetChanges(SyncGroupMetadata groupMetadata, SyncSession syncSession)\r\n   at Microsoft.Synchronization.SyncAgent.DownloadChanges(SyncGroupMetadata groupMetadata)\r\n   at Microsoft.Synchronization.SyncAgent.Synchronize()\r\n   at SmartDeviceTest.ContactForm.Synchronise()\r\n   at SmartDeviceTest.ContactForm.AddContactButton_Click(Object sender, EventArgs e)\r\n   at System.Windows.Forms.Control.OnClick(EventArgs e)\r\n   at System.Windows.Forms.Button.OnClick(EventArgs e)\r\n   at System.Windows.Forms.ButtonBase.WnProc(WM wm, Int32 wParam, Int32 lParam)\r\n   at System.Windows.Forms.Control._InternalWnProc(WM wm, Int32 wParam, Int32 lParam)\r\n   at Microsoft.AGL.Forms.EVL.EnterMainLoop(IntPtr hwnMain)\r\n   at System.Windows.Forms.Application.Run(Form fm)\r\n   at SmartDeviceTest.Program.Main()\r\n"             string

    InnerException:

                                    _message           "The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://tempuri.org/:groupMetadata. The InnerException message was 'Error in line 3 position 88. 'EndElement' 'groupMetadata' from namespace 'http://tempuri.org/' is not expected. Expecting element '_batchCount'.'.  Please see InnerException for more details."    String

    Stack Trace:

                                    StackTrace          "   at System.Web.Services.Protocols.SoapHttpClientProtocol.doInvoke(String methodName, Object[] parameters, WebClientAsyncResult asyncResult)\r\n   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)\r\n   at SmartDeviceTest.myDatabaseCacheWebRef.myDatabaseCacheSyncService.GetChanges(SyncGroupMetadata groupMetadata, SyncSession syncSession)\r\n   at System.Reflection.RuntimeMethodInfo.InternalInvoke(RuntimeMethodInfo rtmi, Object obj, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess, StackCrawlMark& stackMark)\r\n   at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean verifyAccess, StackCrawlMark& stackMark)\r\n   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)\r\n   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)\r\n   at Microsoft.Synchronization.Data.ServerSyncProviderProxy.GetChanges(SyncGroupMetadata groupMetadata, SyncSession syncSession)\r\n   at Microsoft.Synchronization.SyncAgent.DownloadChanges(SyncGroupMetadata groupMetadata)\r\n   at Microsoft.Synchronization.SyncAgent.Synchronize()\r\n   at SmartDeviceTest.ContactForm.Synchronise()\r\n   at SmartDeviceTest.ContactForm.AddContactButton_Click(Object sender, EventArgs e)\r\n   at System.Windows.Forms.Control.OnClick(EventArgs e)\r\n   at System.Windows.Forms.Button.OnClick(EventArgs e)\r\n   at System.Windows.Forms.ButtonBase.WnProc(WM wm, Int32 wParam, Int32 lParam)\r\n   at System.Windows.Forms.Control._InternalWnProc(WM wm, Int32 wParam, Int32 lParam)\r\n   at Microsoft.AGL.Forms.EVL.EnterMainLoop(IntPtr hwnMain)\r\n   at System.Windows.Forms.Application.Run(Form fm)\r\n   at SmartDeviceTest.Program.Main()\r\n"             string

    Tuesday, November 11, 2014 6:23 AM

All replies