POST
|
I am using a SOE on top of a MapService in order to enable complex editing of the features in my File-Geodatabase. We use a SOE as we have much ArcObjects-code in our code-base that wraps rows from within a table to actual features. So in fact a feature consists of several rows in different tables, thus updates to a single row should be notified by the others. We´re also using topological edits which I suppose a feature-service can´t handle. When I try to edit a feature I get the following error: Workspace or data source is read only. If I understand things right, a map-service is just for presenting a map, not for modifying the data. This is where a feature-service would come into play, which however does not have support for a Server-object-extension and thus won´t handle our business-logic very well. I´ve already tried to read the connection-properties of the underlying map-service and re-open it: public void Init ( IServerObjectHelper pSOH ) { serverObjectHelper = pSOH ; if ( serverObjectHelper . ServerObject . TypeName == "MapServer" ) { m_mapServer = serverObjectHelper . ServerObject as IMapServer ; m_mapServerDataAccess = ( IMapServerDataAccess ) serverObjectHelper . ServerObject ; } IMapServerInfo mapServerInfo = m_mapServer . GetServerInfo ( m_mapServer . MapName [ 0 ] ) ; IMapLayerInfos mapLayerInfos = mapServerInfo . MapLayerInfos ; for ( int layerId = 0 ; layerId < mapLayerInfos . Count ; layerId ++ ) { IFeatureClass fc = ( IFeatureClass ) m_mapServerDataAccess . GetDataSource ( m_mapServer . MapName [ 0 ] , layerId ) ; if ( fc != null ) { IDataset fsDataset = ( IDataset ) fc ; m_workspace = fsDataset . Workspace ; } if ( m_workspace != null ) break ; } if ( this . m_workspace == null ) throw new ArcGISAccessException ( "Workspace could not be opened" ) ; var props = this . m_workspace . ConnectionProperties ; var factory = new FileGDBWorkspaceFactory ( ) ; var editWorkspace = factory . Open ( props , 0 ) ; } However this yields to the examt same error. I can´t see what I´m doing different than the code from the samples. I also noticed that I am able to edit the data in the geodatabase in ArcMap without any problems, even when it is used by the map-service. EDIT: To limit the cause of error I set up a completely new service that references a newly created File-Geodatabase containing only a single feature within a featureclass ("FC"). Now I update that feature within my request-handler: private byte [ ] ModifyFeature ( NameValueCollection boundVariables , JsonObject operationInput , string outputFormat , string requestProperties , out string responseProperties ) { responseProperties = null ; var featureWorkspace = ( IFeatureWorkspace ) this . m_workspace ; var editWorksopace = ( IWorkspaceEdit ) this . m_workspace ; var featureClass = featureWorkspace . OpenFeatureClass ( "FC" ) ; var feature = featureClass . Search ( null , false ) . NextFeature ( ) ; var index = featureClass . FindField ( "MyAttribute" ) ; if ( featureClass . Fields . Field [ index ] . Editable ) { editWorksopace . StartEditing ( false ) ; editWorksopace . StartEditOperation ( ) ; feature . set_Value ( index , "Hallo" ) ; feature . Store ( ) ; editWorksopace . StopEditOperation ( ) ; editWorksopace . StopEditing ( true ) ; } var result = new JsonObject ( ) ; result . AddString ( "Status" , "OK" ) ; return Encoding . UTF8 . GetBytes ( result . ToJson ( ) ) ; } I still get the same error, although I even check if the field of that feature is editable.
... View more
05-02-2018
08:23 AM
|
0
|
2
|
164
|
POST
|
This seems to push some light into the aactual problem, as I now get a HttpRequestException "The remote certificate is invalid according to the validation process."
... View more
03-15-2018
04:22 AM
|
0
|
1
|
110
|
POST
|
I followed the samples from ESRI (e.g. this one from GitHub) to enable feature-access to my service and everything worked fine. Next I changed the URL into my own feature-service and provided my crendetials to access that service. So I ended up with the following code: //var serviceUrl = " http://sampleserver6.arcgisonline.com/arcgis/rest/services/DamageAssessment/FeatureServer/0 "; var serviceUrl = " https://myhost/arcgis/rest/services/MyService/FeatureServer/0 " ; ServerInfo serverInfo = new ServerInfo { ServerUri = new Uri ( serviceUrl ) , TokenAuthenticationType = TokenAuthenticationType . ArcGISToken , TokenServiceUri = new Uri ( " https://myhost/arcgis/admin/generateToken " ) } ; AuthenticationManager . Current . RegisterServer ( serverInfo ) ; AuthenticationManager . Current . ChallengeHandler = new ChallengeHandler ( async info = > await AuthenticationManager . Current . GenerateCredentialAsync ( info . ServiceUri , user , password , info . GenerateTokenOptions ) ) ; var featureTableUri = new System . Uri ( serviceUrl ) ; var table = new ServiceFeatureTable ( featureTableUri ) ; var queryParameters = new QueryParameters { WhereClause = "1 = 1" } ; FeatureQueryResult features = await table . QueryFeaturesAsync ( queryParameters ) ; When I execute this code I get the following exception on the last line, which doesn´t seem very meaningful to me: Exception thrown : 'System.InvalidOperationException' in mscorlib . dll Additional information : Cannot call this method in this context : Object failed to load , unable to execute task . When I set a breakpoint on the GenerateCredentialAsync-line (line 12) I also notice it´s never hit. So I wonder if the challengehandler is even registered correctly and fires the challenge-event appropriately.
... View more
03-14-2018
12:58 AM
|
0
|
3
|
544
|
POST
|
How did you solve point 1? What did you change in youc csproj-file?
... View more
02-26-2018
06:57 AM
|
1
|
0
|
201
|
POST
|
I agree that Runtime enables rich functionality and probably most of our needs. However we still have the problem on accessing the runtime-app as a service from our web-client.
... View more
02-21-2018
11:50 PM
|
0
|
0
|
17
|
POST
|
Thanks for your reply. We already checked the Server-Extensions. However we´re unsure on how far those will be supported in the future as they are based on ArcObjects. Of course we could re-use some of our legacy-code, but it doesn´t seem a good alternative though. On the other side we could use some GeoProcessing-modells. Unfortunately debugging those models can be hard and annoying. Furthermore it still needs the client (in our case the Runtime-app) to call that model-functionality in some way and expose it to the web-client. Or can we access those models directly within the ArcGIS-server from our web-client?
... View more
02-21-2018
11:42 PM
|
0
|
0
|
17
|
POST
|
We´re are re-designing our desktop-app which consists of some millions of lines of ArcObjects-code. To do this, we plan to create a prototype based on ArcGIS Server and the Runtime SDK. But in contrast to the samples we plan to use the runtime-client as a service to access it within a WebGIS, where the actual presentation happens. So we end up a three-tier-architecture with an ArcGIS-Server as data-layer, the runtime-app as business-layer and the web-client as presentation-layer. So my question is if this is possible with the runtime-SDK or if there are better oppourtunities to extend the ArcGIS-server with some business-logic. Some words to that logic: currently it contains dozens of event-handlers registered to the events propagated by ArcMap as well as the geodatabase. So in order to store a feature, we need to be able to implicitely update other features that may be related. This in fact triggers recursive store-operations to those features. Another feature we´re currently using and extending is the ability to undo and redo operations or even rollback the entire session. I know this question is fairly complex and not easy to answer. But so far we couldn´t get any idea on which framework to use.
... View more
02-21-2018
06:37 AM
|
0
|
4
|
119
|
POST
|
Hi Karl, on your last paragraph did you intended to set the assemblies locxation within the ArcMap.exe.config? Checked esriregasm´s version also, it´s 32bit one located at "C:\Program Files (x86)\Common Files\ArcGIS\bin" The registry-key you´ve mentioned contains entry codebase showing to the exact same path as my target-path I´m compiling into. What makes me wonder is that I have five different InProcServer32-folders under that key. They obviously serve different versions of my assembly - Version 24, 25, 30, 32, 35 and 36. I recently checked out our latest build for version 35 and compiled it. Anyway all the values for codebase show to the exact same path as my target-path in Visual Studio.
... View more
12-05-2017
01:32 AM
|
0
|
0
|
49
|
POST
|
I created an ITool (not an AddIn) which I embed within a toolbar ( MyToolbar ). The code for the entire toolbar is located within one single assembly, let´s call it MyAssembly . It´s written in C#, which compiles for .NET 3.5, x86 in debug-mode. All PDB-files are appropriately copied to my assemblies bin-folder. Here is some short code for the toolbar: Snippet namespace MyNamespace . Toolbars { using System ; using System . Runtime . InteropServices ; using System . Collections . Generic ; using ESRI . ArcGIS . SystemUI ; using ESRI . ArcGIS . ADF . CATIDs ; [ System . Runtime . InteropServices . ComVisibleAttribute ( true ) ] #region "COM GUIDs" [ ClassInterface ( System . Runtime . InteropServices . ClassInterfaceType . None ) ] [ Guid ( "D8F25094-0F43-4aea-83C6-8DE4187101C9" ) ] #endregion public sealed class MyToolbar : IToolBarDef { #region Component Category Registration [ ComRegisterFunction ( ) ] static void Reg ( String regKey ) { MxCommandBars . Register ( regKey ) ; } [ ComUnregisterFunction ( ) ] static void Unreg ( String regKey ) { MxCommandBars . Unregister ( regKey ) ; } #endregion } // ... // implementation for IToolbar // ... } Now I start ArcMap and try to attch that code to it. When I set any breakpoint, it´ll not hit, because "no symbols have been loaded for this document". I allready uninstalled my assembly from GAC and used esriregasm to unregister any potential previous version of the file. To do so I used this: esriregasm.exe /p:desktop /u /s MyAssembly.dll To re-register I have some post-processing within my VS-project that calls esriregasm again < Target Name = " AfterBuild " > < Exec WorkingDirectory = " $(CommonProgramFiles)\ArcGIS\bin " Command = " esriRegasm.exe "$(TargetPath)" /p:Desktop /s " /> </ Target > I also re-started VS and my computer as well, cleaned my solution and rebuilt it (which is the standard procedure for this problem when attaching any .NET-code to a program), however I still can´t break into the code. Another possibly related issue to this is, that I can´t put my toolbar into ArcMap. As soon as I add the toolbar via RightClick --> MyToolbar, ArcMap crashes without any error-message, not even in its log-file.
... View more
11-28-2017
12:32 AM
|
0
|
4
|
194
|
Online Status |
Offline
|
Date Last Visited |
Monday
|