none
Format Exception Syncing from Windows Mobile 6.1 RRS feed

  • Question

  • We're currently working through the final stages of QA on a sync framework project running on windows mobile 6 symbol scanners via a WCF service. 

    Basically when the user syncs its throwing a TargetInvocationException with an inner exception of Format Exception.  When I look at the ASP logs the last operation I see is ApplyChanges but there are no errrors reported.  I'm having a hard time debugging this...

    Has anyone else run into anything similar?

    Wednesday, December 8, 2010 1:53 PM

All replies

  • try enabling Sync Fx Tracing or WCF tracing so you get a more detailed trace of the error.
    Wednesday, December 8, 2010 3:18 PM
    Moderator
  • I'll give it a shot and let you know how it goes.
    Wednesday, December 8, 2010 3:21 PM
  • This is the last message I see... but it doesn't really point me to anything useful..

    <E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
    <System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
    <EventID>0</EventID>
    <Type>3</Type>
    <SubType Name="Information">0</SubType>
    <Level>8</Level>
    <TimeCreated SystemTime="2010-12-08T18:32:42.7997224Z" />
    <Source Name="System.ServiceModel.MessageLogging" />
    <Correlation ActivityID="{189052fb-0139-46e7-b6e8-5bf6355144d8}" />
    <Execution ProcessName="aspnet_wp" ProcessID="6260" ThreadID="11" />
    <Channel />
    <Computer>QA3</Computer>
    </System>
    <ApplicationData>
    <TraceData>
    <DataItem>
    <MessageLogTraceRecord Time="2010-12-08T13:32:42.7997224-05:00" Source="TransportSend" Type="System.ServiceModel.Dispatcher.OperationFormatter+OperationFormatterMessage" xmlns="http://schemas.microsoft.com/2004/06/ServiceModel/Management/MessageTrace">
    <Addressing>
    <Action>http://tempuri.org/IHcnMobileDeliveriesSyncContract/ApplyChangesResponse</Action>
    </Addressing>
    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
    <s:Header>
    <ActivityId CorrelationId="2683b67e-e57b-4437-a950-e5fa36321349" xmlns="http://schemas.microsoft.com/2004/09/ServiceModel/Diagnostics">189052fb-0139-46e7-b6e8-5bf6355144d8</ActivityId>
    </s:Header>
    </s:Envelope>
    </MessageLogTraceRecord>
    </DataItem>
    </TraceData>
    </ApplicationData>
    </E2ETraceEvent>
    

     

    Wednesday, December 8, 2010 6:48 PM
  • so no error occured at this time? nothing in WCF logs?
    Wednesday, December 8, 2010 11:40 PM
    Moderator
  • There was no error in the logs... however I'm now able to trae it down on the server side.

    It appears that a number of rows on the device are conflicting with the server.  The funny thing is these rows had already been applied to the server at one time... it now thinks that these rows are being inserted into the server and as a result its throwing key violations.

    I'm using Sql Server 2008 & change tracking to keep track of changes -- now I'm trying to figure out the best way to implement some sort of conflict resolution to handle a situationsuch as this.

    Do you have any suggestions?

    Thursday, December 9, 2010 1:21 AM
  • Here is the stack trace from the device after an attempt at conflict resolution.  I was able to have it reapply changes which looks like it applied changes as updates instead of inserts.  The conflict count goes down to 0 but I still get a format exception on the device...

    Here is a stack trace fromt he device...

      at System.Convert.FromBase64CharArrayHelper(Char* pCharArray, Int32 offset, Int32 length)
      at System.Convert.FromBase64String(String s)
      at System.Data.Common.ObjectStorage.ConvertXmlToObject(String s)
      at System.Data.DataColumn.ConvertXmlToObject(String s)
      at System.Data.XmlDataLoader.LoadColumn(DataColumn column, Object[] foundColumns)
      at System.Data.XmlDataLoader.LoadTable(DataTable table, Boolean isNested)
      at System.Data.XmlDataLoader.LoadData(XmlReader reader)
      at System.Data.DataSet.ReadXmlDiffgram(XmlReader reader)
      at System.Data.DataSet.ReadXml(XmlReader reader, XmlReadMode mode, Boolean denyResolving)
      at System.Data.DataSet.ReadXmlSerializable(XmlReader reader)
      at System.Data.DataSet.System.Xml.Serialization.IXmlSerializable.ReadXml(XmlReader reader)
      at System.Xml.Serialization.XmlSerializationReader.DeserializeSerializableElement(LogicalType deserializeAs, Accessor accessor, Fixup fixup, Object fixupTarget, String identifier, Boolean emptyValue, Boolean nullValue)
      at System.Xml.Serialization.XmlSerializationReader.deserializeElement(Accessor accessor, Fixup fixup, Object fixupTarget)
      at System.Xml.Serialization.XmlSerializationReader.DeserializeElementMember(MemberValueCollection members, Object fixupTarget, Hashtable internalState, Boolean& firstElement)
      at System.Xml.Serialization.XmlSerializationReader.deserializeMembers(MemberValueCollection members, Object fixupTarget)
      at System.Xml.Serialization.XmlSerializationReader.DeserializeComplexElement(LogicalType deserializeAs, Accessor accessor, Fixup fixup, Object fixupTarget, String identifier, Boolean emptyValue, Boolean nullValue)
      at System.Xml.Serialization.XmlSerializationReader.deserializeElement(Accessor accessor, Fixup fixup, Object fixupTarget)
      at System.Xml.Serialization.XmlSerializationReader.DeserializeElementMember(MemberValueCollection members, Object fixupTarget, Hashtable internalState, Boolean& firstElement)
      at System.Xml.Serialization.XmlSerializationReader.deserializeMembers(MemberValueCollection members, Object fixupTarget)
      at System.Xml.Serialization.XmlSerializationReader.DeserializeComplexElement(LogicalType deserializeAs, Accessor accessor, Fixup fixup, Object fixupTarget, String identifier, Boolean emptyValue, Boolean nullValue)
      at System.Xml.Serialization.XmlSerializationReader.deserializeElement(Accessor accessor, Fixup fixup, Object fixupTarget)
      at System.Xml.Serialization.XmlSerializationReader.DeserializeElementMember(MemberValueCollection members, Object fixupTarget, Hashtable internalState, Boolean& firstElement)
      at System.Xml.Serialization.XmlSerializationReader.deserializeMembers(MemberValueCollection members, Object fixupTarget)
      at System.Web.Services.Protocols.SoapMessageParser.execute()
      at System.Web.Services.Protocols.SoapMessageSerializer.Deserialize(XmlReader reader, SoapHttpClientProtocol client, LogicalSoapMethod soapMethod, Boolean soap12)
      at System.Web.Services.Protocols.SoapHttpClientProtocol.doInvoke(String methodName, Object[] parameters, WebClientAsyncResult asyncResult)
      at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
      at HcnMobileDeliveries.HcnMDeliveriesHost.HcnMobileDeliveriesSyncService.ApplyChanges(SyncGroupMetadata groupMetadata, DataSet dataSet, SyncSession syncSession)
      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)
      at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean verifyAccess, StackCrawlMark& stackMark)
      at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
      at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
      at Microsoft.Synchronization.Data.ServerSyncProviderProxy.ApplyChanges(SyncGroupMetadata groupMetadata, DataSet dataSet, SyncSession syncSession)
      at Microsoft.Synchronization.SyncAgent.UploadChanges(SyncGroupMetadata groupMetadata)
      at Microsoft.Synchronization.SyncAgent.Synchronize()
      at HcnMobileDeliveries.SyncForm.DoSync()
      at HcnMobileDeliveries.SyncForm.SyncForm_Load(Object sender, EventArgs e)
      at System.Windows.Forms.Form.OnLoad(EventArgs e)
      at System.Windows.Forms.Form._SetVisibleNotify(Boolean fVis)
      at System.Windows.Forms.Control.set_Visible(Boolean value)
      at System.Windows.Forms.Form.ShowDialog()
      at HcnMobileDeliveries.Main.PerformNormalSync_Click(Object sender, EventArgs e)
      at System.Windows.Forms.MenuItem.OnClick(EventArgs e)
      at System.Windows.Forms.Menu.ProcessMnuProc(Control ctlThis, WM wm, Int32 wParam, Int32 lParam)
      at System.Windows.Forms.Form.WnProc(WM wm, Int32 wParam, Int32 lParam)
      at System.Windows.Forms.Control._InternalWnProc(WM wm, Int32 wParam, Int32 lParam)
      at Microsoft.AGL.Forms.EVL.EnterModalDialog(IntPtr hwnModal)
      at System.Windows.Forms.Form.ShowDialog()
      at HcnMobileDeliveries.Login.btnLocalLogin_Click(Object sender, EventArgs e)
      at System.Windows.Forms.Control.OnClick(EventArgs e)
      at System.Windows.Forms.Button.OnClick(EventArgs e)
      at System.Windows.Forms.ButtonBase.WnProc(WM wm, Int32 wParam, Int32 lParam)
      at System.Windows.Forms.Control._InternalWnProc(WM wm, Int32 wParam, Int32 lParam)
      at Microsoft.AGL.Forms.EVL.EnterModalDialog(IntPtr hwnModal)
      at System.Windows.Forms.Form.ShowDialog()
      at HcnMobileDeliveries.LaunchForm..ctor()
      at HcnMobileDeliveries.Program.Main()
    
    Thursday, December 9, 2010 2:04 AM
  • Is there any other information that would be useful in figuring out whats happening?

    I'm able to trace it down on the server side to occuring after apply changes -- everything works fine on the server side then control is passed back to the device and thats when the exception occurs.  I've tried every event available on the device side and nothing gets fired... so I can't determine what is going on on the device...

    Thursday, December 9, 2010 11:40 PM
  • We are beginning a upgrade to our sync services 1.0 implementation soon, partly due to similar behavior in our current system.  Are you using 2.1 or 4.0 for your project?
    Friday, February 25, 2011 9:34 PM