Select to view content in your preferred language

Problems to synchronize, ArcGis Mobile SDK

3904
1
Jump to solution
04-08-2014 09:21 AM
MarvinOconitrillo
Occasional Contributor
Hi,

I'm developing an app with the ArcGis Mobile SDK which has to collect points and after that synchonize them. I have already the collecting point part now I have to synchronize but I can't.
I'm using the Mobile Service Connection to the Mobile Cache and after creating the feature Sync Agent to sync the features, at the end with the Feature Sync Results I get on DataSizeSent a value of 2427 however on the layer I'm not getting the new features.

This is the code:
private bool DescargarBoletas(ESRI.ArcGIS.Mobile.FeatureCaching.MobileCache cache)         {             FeatureSource featureSource = null;             MobileServiceConnection con = null;             FeatureSyncAgent featureSyncAgent = null;              try             {                 //Get an access to the FeatureSource as well as the MobileServiceConnection                  featureSource = cache.FeatureSources["CAPA_BOLETAS_INFRACCION"] as FeatureSource;                 con = new MobileServiceConnection();                 con.Url = @"http://crdes05:6080/arcgis/rest/services/MuniCartago/Prueba/MobileServer";                 featureSyncAgent = new FeatureSyncAgent(featureSource, con);                 featureSyncAgent.SynchronizeAttachments = true;                 featureSyncAgent.SynchronizationDirection = SyncDirection.UploadOnly;                  if (featureSyncAgent.IsValid)                 {                     FeatureSyncResults synResults = (FeatureSyncResults)featureSyncAgent.Synchronize();                      if (synResults.DataSizeSent > 0)                         return true;                     else                         return false;                 }                 else                 {                     return false;                 }             }//fin try             catch (Exception ex)             {                 return false;             }             finally             {                 featureSyncAgent.Dispose();                 con.Dispose();             }         }


At the stack trace on the results I'm getting the following description:
en System.Net.HttpWebRequest.finishGetResponse() en System.Net.HttpWebRequest.GetResponse() en ESRI.ArcGIS.Mobile.FeatureCaching.Synchronization.BinaryWebService.ExecuteRequest(Stream stream) en ESRI.ArcGIS.Mobile.FeatureCaching.Synchronization.MobileServiceConnection.ExecuteRequest(Stream requestStream) en ESRI.ArcGIS.Mobile.FeatureCaching.Synchronization.MapDocumentConnection.Execute(Stream requestStream) en ESRI.ArcGIS.Mobile.FeatureCaching.Synchronization.FeatureSyncAgent.UploadEditStream(Stream stream, Dictionary`2 gidFidDictionary, FeatureSyncResults results) en ESRI.ArcGIS.Mobile.FeatureCaching.Synchronization.FeatureSyncAgent.Upload(QueryFilter uploadFilter, FeatureSyncResults results) en ESRI.ArcGIS.Mobile.FeatureCaching.Synchronization.FeatureSyncAgent.Synchronize() en Boletas_Infraccion.geotecnologias.co.cr.util.SincronizacionCache.DescargarBoletas(MobileCache cache) en Boletas_Infraccion.geotecnologias.co.cr.util.SincronizacionCache.Sincronizar() en Boletas_Infraccion.Form_CargaDescargaDatos.uiButton_descargarBoletas_Click(Object sender, UIMouseEventArgs e) en Resco.UIElements.UIElement.OnClick(UIMouseEventArgs e) en Resco.UIElements.Controls.UIElementControl.OnMouseUp(MouseEventArgs e) en System.Windows.Forms.Control.WnProc(WM wm, Int32 wParam, Int32 lParam) en System.Windows.Forms.Control._InternalWnProc(WM wm, Int32 wParam, Int32 lParam) en Resco.UIElements.Internals.NativeMethods.CallWindowProcCE(IntPtr prevWndFunc, IntPtr hWnd, WM msg, Int32 wParam, Int32 lParam) en Resco.UIElements.Internals.NativeMethods.CallWindowProc(IntPtr prevWndFunc, IntPtr hWnd, WM msg, Int32 wParam, Int32 lParam) en Resco.UIElements.Controls.UIElementControl.NativeWndProc(IntPtr hWnd, WM msg, Int32 wParam, Int32 lParam) en Microsoft.AGL.Forms.EVL.EnterModalDialog(IntPtr hwnModal) en System.Windows.Forms.Form.ShowDialog() en Boletas_Infraccion.Form_Principal.menuItem_cargaDescarga_Click(Object sender, EventArgs e) en System.Windows.Forms.MenuItem.OnClick(EventArgs e) en System.Windows.Forms.Menu.ProcessMnuProc(Control ctlThis, WM wm, Int32 wParam, Int32 lParam) en System.Windows.Forms.Form.WnProc(WM wm, Int32 wParam, Int32 lParam) en System.Windows.Forms.Control._InternalWnProc(WM wm, Int32 wParam, Int32 lParam) en Microsoft.AGL.Forms.EVL.EnterMainLoop(IntPtr hwnMain) en System.Windows.Forms.Application.Run(Form fm) en Boletas_Infraccion.Program.Main()


I attached 2 files first with the connection state on the wathc window, and the other one with the feature sync result on the watch window.

Could someone tell me if I'm using correctly the feature synchronization or the reason I'm getting that "finishGetResponse()" when I try to sync?

I

Thanks in advance
0 Kudos
1 Solution

Accepted Solutions
by Anonymous User
Not applicable
Original User: Marvin_84

I resolved the problem; my error was I used a wrong URL for the Feature Sync Agent, where the correct is the one which appear when you enable the "Mobile Data Access" with the URL SOAP.

View solution in original post

0 Kudos
1 Reply
by Anonymous User
Not applicable
Original User: Marvin_84

I resolved the problem; my error was I used a wrong URL for the Feature Sync Agent, where the correct is the one which appear when you enable the "Mobile Data Access" with the URL SOAP.
0 Kudos