Runtime editing in a disconnected mode

7187
28
07-25-2011 10:36 AM
AngelGonzalez
Occasional Contributor II
OK, I read the Runtime SDK for WPK and I have a question. If you deploy a runtime app onto a laptop and download the data on the laptop from ArcSDE and have the app point to the local copy of the datasource (.mpk) can you do editing (in my case attribute editing only) if the laptop does not have any connectivity to the ArcSDE server? That is the laptop will not have any internet/intranet connections? 

I also read "Editing with the ArcGIS Runtime SDK for WPF requires a feature service" Does this mean editing can only be done in a connect mode?

I also saw something about "Managing ArcGIS Runtime local services" Does this mean we can create a local service for editing?

Thanks
0 Kudos
28 Replies
DevalChauhan
New Contributor
Does ArcGIS Runtime requires application to run in Full Trust?
0 Kudos
RobertZargarian
New Contributor III
Hi
I am trying to test if disconnected editing is working with
ArcGIS Runtime. I followed your instructions but unfortunately got following problems.

Best regards!
Robert Zargarian
Zettateq AB

Disconnected editing:

The basic process is to use ArcMap (ArcGIS for Desktop 10.1 Beta 1) to create a Map Package (MPK) in which you can edit data using a local feature service provided by the ArcGIS Runtime then check those edits back into your ArcSDe GDB:

1. Open ArcMap - ArcGIS for Desktop 10.1 (Beta 1) - and add the layers you wish to edit from your ArcSDE GDB.

OK

2. Create a checkout/checkin replica of these layers - this must be in a File GDB.

OK

3.  Ensure the File GDB is being created in the required folder (e.g. your deployment folder)

OK

4.  The checkout process can switch your Map to point to the new;y checked-out data or open a new ArcMap session and add the Feature Classes within the File GDB then symbolize as required.

OK

5.  Ensure that ArcMap is set to use relative paths within ArcMap Document properties (off the File menu).

OK (se pict. For my settings at the end of attached doc.)

6. Go to Customize > ArcMap Options and select the Sharing tab. Ensure that the Enable ArcGIS Runtime Tools option is checked.

OK

7. Open the Map Packaging dialog by using the File > Share As... > Map Package option within ArcMap.

OK

8.  Ensure the "Make ArcGIS Runtime compatible" option is checked and that the option beneath this is also checked - to "Reference all data" and that the MPK is going to sit alongside the File GDB you created (so that the relative paths work).

Got an ERROR (se the pict. in Attached doc). I set document to use absolute paths and continue.


9. Then click Share - this will create a small Map Package (.MPK) which references the File GDB containing the replica.

OK

10. This MPK and File GDB should be deployed to the deployment machine when you deploy your application. The ArcGIS Runtime can also use relative paths (e.g. ..\..\Data\MyEditLayers.MPK).

OK

11. Now you can create a LocalFeatureService using the ArcGIS Runtime WPF API, based on that MPK and create one or more LocalFeatureLayers based on layers within that MPK (i.e. as you would with layers within an ArcGIS Server FeatureService).

I Couldn´t reference this MPK as LocalFeatureLayers - got following error
ESRI.ArcGIS.Client.Local.LocalServerException was unhandled
  Message=Failed to create service ch_test1 MapServer. Worker process 'ch_test1_host' exited while attempting to service request (attempt 1 of 1): endpoint='admin' headers={} params={editable=, filePath=c:\data\giss\geodatabaser\test\ch_test1.mpk, maxRecords=1000, name=ch_test1, outputDir=C:\Users\xroza03\AppData\Local\Temp\arcgisruntime_7660\ch_test1, type=MapServer, virtualDir=http://127.0.0.1:50001/Jb0rS3/outputdir/ch_test1} res='create' post=0 Crash dump path=C:\Users\xroza03\AppData\Local\Temp\ArcGISRuntimeErrorReports\arcgisruntime_10.1.0.2923_service_20120120_171051.dmp Error code: 500
  Source=ESRI.ArcGIS.Client
  StackTrace:
       vid ESRI.ArcGIS.Client.Layer.OnInitializationFailed(EventArgs e)
       vid ESRI.ArcGIS.Client.Layer.Initialize()
       vid ESRI.ArcGIS.Client.FeatureLayer.Initialize()
       vid ESRI.ArcGIS.Client.Local.ArcGISLocalFeatureLayer.FailInitialize(Exception error)
       vid ESRI.ArcGIS.Client.Local.ArcGISLocalFeatureLayer.CompleteServiceInitialize(LocalMapService mapService)
       vid ESRI.ArcGIS.Client.Local.LocalFeatureService.<>c__DisplayClass1e.<GetServiceAsync>b__1d(Object s, AsyncCompletedEventArgs e)
       vid ESRI.ArcGIS.Client.Local.LocalService.OnStartCompleted()
       vid ESRI.ArcGIS.Client.Local.LocalService.FailStart(Exception error)
       vid ESRI.ArcGIS.Client.Local.LocalService.<ContinueStartService>b__a(CreateServiceResponse createServiceResponse, RequestInfo createServiceInfo)
       vid ESRI.ArcGIS.Client.Local.Internal.Requests.ProcessResponse[TExpectedResponse](String url, String queryParameters, Exception err, Boolean cancelled, String result, Action`2 callback)
       vid ESRI.ArcGIS.Client.Local.Internal.Requests.<>c__DisplayClass7`1.<Start>b__2(Object s, UploadStringCompletedEventArgs e)
       vid System.Net.WebClient.OnUploadStringCompleted(UploadStringCompletedEventArgs e)
       vid System.Net.WebClient.UploadStringOperationCompleted(Object arg)
       vid System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       vid MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
       vid System.Windows.Threading.DispatcherOperation.InvokeImpl()
       vid System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
       vid System.Threading.ExecutionContext.runTryCode(Object userData)
       vid System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
       vid System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
       vid System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       vid System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       vid System.Windows.Threading.DispatcherOperation.Invoke()
       vid System.Windows.Threading.Dispatcher.ProcessQueue()
       vid System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       vid MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       vid MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
       vid System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       vid MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
       vid System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
       vid MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
       vid MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
       vid System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
       vid System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
       vid System.Windows.Application.RunDispatcher(Object ignore)
       vid System.Windows.Application.RunInternal(Window window)
       vid System.Windows.Application.Run(Window window)
       vid System.Windows.Application.Run()
       vid ArcGISRuntimeTest1.App.Main() i C:\Projects\Tester\ArcGISRuntimeTest1\ArcGISRuntimeTest1\obj\Debug\Application.g.cs:rad 0
       vid System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       vid System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       vid Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       vid System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       vid System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       vid System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       vid System.Threading.ThreadHelper.ThreadStart()
  InnerException:

12. Develop an editing UI e.g. using the Template Picker or Editor with the Toolkit library.
Once your edits are done - to reintegrate the edits to your ArcSDE GDB you need to grab the File GDB that you deployed and use ArcGIS for Desktop 10.1 (Beta 1) to checkin the edits. Alternatively you could explore using Geoprocessing tools for this purpose.


I tested also to make .MPK file with option to �??reference all data�?� unchecked. I could create LocalFeatureService and edit it with ArcGIS runtime. But I notice that when I did this a fileGDB was created automatically in some default directory (C:\Users\myuser \Documents\ArcGIS\Packages)  and my edits where saved in this GDB. I tried to check-in this GDB but check-in button was disabled in ArcMap.
Further I noticed that I got some corrupt replicas while testing default checkout function. Those corrupted replicas resulted that I could not open ArcCatalog or ArcMap-mxd with SDE-connection to my DB. I recognize this problem from earlier versions but now it seems that it is back. When I truncated GDB_Replicas and GDB_Datasets tables in SDE schema, it started to work normally again. I am using ArcMap 10.1 beta and SDE 9.3.1 on Oracle 11.1.0.7.
0 Kudos
MichaelBranscomb
Esri Frequent Contributor
Hi,

At Beta 2 the ArcGIS for Desktop packaging analyzers will prevent you creating an ArcGIS Runtime compatible package (MPK) with relative paths to ensure that valid packages are always created. The error you are seeing is most likely because the local feature service cannot find the File GDB which the Map Package (MPK) is referencing because it's using the path by which the Map Document (MXD) was originally referencing the data. The best approach is to us a UNC path / map a network drive so that ArcMap and the ArcGIS Runtime on their respective machines can both see the File GDB by the same path.

Cheers

Mike
0 Kudos
RobertZargarian
New Contributor III
Thanks for the feedback on this topic!
I am not shore if I understand completely. Is the release version of Runtime going to support relative paths?
We have a arcgis server extension that uses customized checkout to checkout data to a .mdb GDB (this could be changed to use file GDB).
The user requests a checkout from this service and gets file GDB and .MPK file copied to his mashie. Then he is out and editing data in ArcGIS Runtime on field,
disconnected from network. After some days he is back in office and checks in edited geodatabase .  Is this scenario possible with disconnected
editing provided by ArcGIS Runtime?

Thanks!
Robert
0 Kudos
RobertZargarian
New Contributor III
Hi Mike,

I did some more testing in editing in a disconnected mode. But I don't thik
I really understand how paths are working.
We have a server machine with ArcGIS Desktop 10.1 beta 2 installed and a
Client machine with only ArcGIS Runtime.
I mapped a directory on my server to a directory on my client machine.
(V:\Data\GISS\Geodatabaser\ch5)
Then I checkout data to a file-gdb to the maped directory
(V:\Data\GISS\Geodatabaser\ch5\ch_test5.gdb)
Then I created a new .mxd file in the same directory, added some layers from
file-gdb and saved it
(V:\Data\GISS\Geodatabaser\ch5\ch_test5.mxd)
Then I opened ch_test5.mxd on server and created a map package in the same directory
with options "reference all data", "Enable Runtime Tools" and "Support arcGIS Runtime"
(V:\Data\GISS\Geodatabaser\ch5\ch_test5.mpk)
Then I logged in on my client computer and tried to start test Runtime application.
This application
starts LocalFeatureService with GetServiceAsync and adds some  ArcGISLocalFeatureLayer to
map layers. Application was working with .MPK with options to not "reference all data".

Then I see the Error for localFeatureService object in debug. I even tried to map the same directory from
my client machine V:\Data\GISS\Geodatabaser\ch5\ but I got the same error. Can you please teach me how to
do disconnected editing in right way. Disconnected editing is the central workflow in our editing.
Is it possible to create map package with geoprocessing tool on a machine that only have ArcGIS Runtime.

Tanks!


"Failed to create service ch_test5 MapServer. Worker process 'ch_test5_host' exited while attempting to service
                             request (attempt 1 of 1): endpoint='admin' headers={}
                             params={editable=,
                             filePath=c:\\data\\giss\\geodatabaser\\ch5\\ch_test5.mpk,
                             maxRecords=1000,
                             name=ch_test5,
                             outputDir=C:\\Users\\xroza03\\AppData\\Local\\Temp\\arcgisruntime_5124\\ch_test5,
                             type=MapServer,
                             virtualDir=http://127.0.0.1:50000/7NqjTH/outputdir/ch_test5} res='create' post=0 Crash dump
                             path=C:\\Users\\xroza03\\AppData\\Local\\Temp\\ArcGISRuntimeErrorReports\\arcgisruntime_10.1.0.2923_service_20120126_115212.dmp
                             Error code: 500"
}

    [ESRI.ArcGIS.Client.Local.LocalServerException]:
{"Failed to create service ch_test5 MapServer. Worker process 'ch_test5_host'
exited while attempting to service request (attempt 1 of 1):
                             endpoint='admin' headers={} params={editable=,
                             filePath=c:\\data\\giss\\geodatabaser\\ch5\\ch_test5.mpk,
                             maxRecords=1000,
                             name=ch_test5,
                             outputDir=C:\\Users\\xroza03\\AppData\\Local\\Temp\\arcgisruntime_5124\\ch_test5,
                             type=MapServer,
                             virtualDir=http://127.0.0.1:50000/7NqjTH/outputdir/ch_test5
}

res='create' post=0 Crash dump
                             path=C:\\Users\\xroza03\\AppData\\Local\\Temp\\ArcGISRuntimeErrorReports\\arcgisruntime_10.1.0.2923_service_20120126_115212.dmp
                             Error code: 500"
}
    Data: {System.Collections.ListDictionaryInternal}
    HelpLink: null
    InnerException: null
    Message: "Failed to create service ch_test5 MapServer.
                             Worker process 'ch_test5_host' exited while attempting to service request (attempt 1 of 1):
                             endpoint='admin'
                             headers={}
                             params={editable=,
                             filePath=c:\\data\\giss\\geodatabaser\\ch5\\ch_test5.mpk, maxRecords=1000, name=ch_test5,
                             outputDir=C:\\Users\\xroza03\\AppData\\Local\\Temp\\arcgisruntime_5124\\ch_test5,
                             type=MapServer,
                             virtualDir=http://127.0.0.1:50000/7NqjTH/outputdir/ch_test5} res='create' post=0 Crash dump
                             path=C:\\Users\\xroza03\\AppData\\Local\\Temp\\ArcGISRuntimeErrorReports\\arcgisruntime_10.1.0.2923_service_20120126_115212.dmp Error code: 500"
    Source: null
    StackTrace: null
    TargetSite: null
0 Kudos
MichaelBranscomb
Esri Frequent Contributor
Hi,

Sorry to hear you're experiencing problems getting this working, this workflow should work ok. If you're using a mapped network drive, you'll need the same named drive on both machines (e.g. V:\Data\... ). Otherwise, if you want to edit from the client machine to the other server machine you'll need to use a UNC path (e.g. \\SERVER\C\Data\...).

In ArcMap you will need to add the data from the mapped network drive / virtual drive (I use the doc command subst to create a "virtual drive") so that when you create the map package and choose the "Reference all data" option it will persist the reference to the data via your V:\Data.. location. You should find the MPK that gets created is very small (probably <50KB).

Then when the ArcGIS Runtime starts the LocalFeatureService it will unpack the MPK to your user profile (e.g. C:\Users\mbranscomb\Documents\ArcGIS\Packages\<package_name>\). In that location there will be a v101 (i.e. 10.1) folder which contains the just a couple of map documents (and MSD and an MXD) which the ArcGIS Runtime is using to create the service. You should not see a <map_name>.gdb Geodatabase or any other data. This means that the MPK was correctly created referencing the data by the original path (e.g. V:\Data\...).

Starting a LocalFeatureService from this MPK should now be referencing the data in it's original location via the mapped network drive path. I've tested via both mapped network drives and virtual drives (the subst command approach) and in both cases the internal path within the package is correctly pointing to for example X: or Z: rather than C:.

Cheers

Mike
0 Kudos
RobertZargarian
New Contributor III
Thank you for replying this thread!
I followed your instructions and created a virtual directory with
subst V: C:\
on both server and client machine. Then I created .mxd pointing data
from V:\Data\..\ch5\ch_test5.gdb and also .mpk (59 kb).
Then copied .mpk file to client machine
V:\Data\..\ch5\ virtual directory.
I tried to run a simple Runtime app on my client machine
that just have map control and a layer
<esri:ArcGISLocalDynamicMapServiceLayer Path="V:\\Data\\GISS\\Geodatabaser\\ch5\\ch_test5.mpk" />
And got an error. I checked the C:\Users\xroza03\Documents\ArcGIS\Packages\ch_test58\v101
And it is only ch_test5.msd and ch_test5.mxd files present.

Is it something else I have to configure? The "virtualDir=http://127.0.0.1:50000/kcWYsX/outputdir/ch_test5"
in error message is it right? Whan I was able to se start the service then the path was
http://127.0.0.1:50000/w4RT4s/arcgis/rest/services/ch_test2/MapServer.

Tanks!

Error:
Failed to create service ch_test5 MapServer.
Worker process 'ch_test5_host' exited while attempting to service request (attempt 1 of 1):
endpoint='admin'
headers={}
params={filePath=v:\data\giss\geodatabaser\ch5\ch_test5.mpk,
maxRecords=1000,
name=ch_test5,
outputDir=C:\Users\xroza03\AppData\Local\Temp\arcgisruntime_4448\ch_test5,
type=MapServer,
virtualDir=http://127.0.0.1:50000/kcWYsX/outputdir/ch_test5}
res='create'
post=0
Crash
dump
path=C:\Users\xroza03\AppData\Local\Temp\ArcGISRuntimeErrorReports\arcgisruntime_10.1.0.2923_service_20120126_221512.dmp
Error code: 500
0 Kudos
MichaelBranscomb
Esri Frequent Contributor
Hi,

In the steps you outline, when you say you copied the MPK from the server to the client - did you also copy the File GDB? Or does that already exist on the client machine in C:\Data\... ?

If you want to leave the GDB on the server and edit from the client you'll need to use a UNC path e.g. \\<server>\Data\... . Note that this would be single user editing of that server-side GDB, if you want multi-user editing you'll need to use ArcGIS for Server Basic (Workgroup or Enterprise).

Cheers

Mike
0 Kudos
RobertZargarian
New Contributor III
Sorry for being unclear!
I copied both MPK and GDB files to the client machine.
I need only to edit the .gdb on client machine with ArcGIS Rintime.
After this I want to copy the .gdb to the server machine and check in to the SDE-GDB.

Thanks!
Robert
0 Kudos
MichaelBranscomb
Esri Frequent Contributor
Hi,

Unfortunately the workflow we've been discussing works fine in my testing:

#1. Create virtual / mapped network drive to folder containing data (in my case I've been testing with a virtual drive created using the subst command)
(I used "subst V: C:\")
#2. Open ArcMap
#3. Browse to and add data using virtual drive (in my case V:\Temp\DataToDeploy\DatatoDeploy.gdb)
#4. Save Map document
#5. Share as map package ensuring that both the "Support ArcGIS Runtime" AND "Reference all data" options are checked.
#6. Copy DataToDeploy folder containing File GDB and MPK to a deployment machine.
#7. Create virtual drive on deployment machine (I used "subst V: C:\Projects")
#8. Open an ArcGIS Runtime application which references that MPK (e.g. via "V:\Temp\DataToDeploy\DataToDeploy.MPK")
#9. Application loads MPK and correctly finds data referenced via "V:\Temp\DataToDeploy\DatatoDeploy.gdb" even though the deployment physical location is different to the physical source location.


Cheers

Mike
0 Kudos