Select to view content in your preferred language

Add a little functionality to MapService using SOE, ArcGIS for Server 10.1 (10.11)

3846
7
11-24-2013 07:39 AM
ArthurMazgarov
Emerging Contributor
Hi, All

The problem that served as a reason to post this thread is concerning control over editing operations (Create, Query, Update, Delete) via the rest interface of the MapService in ArcGIS for Server (10.11).

Is it possible to inherit all the functionality of a standard MapService, but somewhat override editing operations or hook them using SOE? Or override edit operation so that it requires some extra parameters? In the Functionality tab of the MapService we see capabilities such as Mapping, Feature Access and etc. Do we need to implement SOE for a FeatureService or MapService or how are they related?

Thanks!
0 Kudos
7 Replies
RichardWatson
Deactivated User
SOE provides the ability to extend map services.  You cannot change them.

You can hook the underlying data via ArcObjects itself.  Perhaps you could define a custom feature class.  This starts to get deep fast and takes you down a path that will cause you pain in the future.
0 Kudos
ArthurMazgarov
Emerging Contributor
SOE provides the ability to extend map services.  You cannot change them.

You can hook the underlying data via ArcObjects itself.  Perhaps you could define a custom feature class.  This starts to get deep fast and takes you down a path that will cause you pain in the future.


Of course we can hook the underlying data using ArcObjects. I ment the way if we can maybe inherit some class or interface providing that very REST interface that we use when editing data through web interfaces. If inheritance is not prohibited, then we might add some portion of code before calling original method... Is that possible? What could be that class or interface, might you know?
0 Kudos
RichardWatson
Deactivated User
There is no built-in mechanism which allows you to do this.

One possible solution is to develop a custom proxy to which you direct ArcGIS Server requests.  In that proxy you can intercept and override messages as needed.
0 Kudos
ArthurMazgarov
Emerging Contributor
There is no built-in mechanism which allows you to do this.

One possible solution is to develop a custom proxy to which you direct ArcGIS Server requests.  In that proxy you can intercept and override messages as needed.


Yeah, this was the first idea that I came up with. I just wondered if there's a simpler way to do this...
0 Kudos
ArthurMazgarov
Emerging Contributor
There is no built-in mechanism which allows you to do this.

One possible solution is to develop a custom proxy to which you direct ArcGIS Server requests.  In that proxy you can intercept and override messages as needed.


Ok then, hello again.
Now I started to use the proxy page and yes, I can intercept and change messages and all.

But when it comes to working with geoprocessing tools, some  strange problem occurs.
There are two somple ways to call/work with geoprocessing in JS API:
1)When we create object pointing to a direct link, somewhat like
new esri.tasks.Geoprocessor("http://<server>:<port>/arcgis/rest/services/Modeling/SetAsCurrent/GPServer/SetAsCurrent");
2)The second way is using the proxy page:
new esri.tasks.Geoprocessor("http://<server>/<web application>/proxy.ashx?http://<server>:<port>/arcgis/rest/services/Modeling/SetAsCurrent/GPServer/SetAsCurrent");

The first way works perfectly, but is not suitable because we cannot intercept it server side, create a log entry etc.
The second way is not working at all, proxy,ashx throws exception "The remote server returned an error: (400) Bad Request", but works well for editing operations.

Strange thing is that, using developer tools in chrome we can see the request uri. And they are different (!):
1)http://<server>:<port>/arcgis/rest/services/Modeling/SetAsCurrent/GPServer/SetAsCurrent/execute?f=json&JobID=j8758a77f9c6245ab8c86646143683b30&callback=dojo.io.script.jsonp_dojoIoScript32._jsonpCallback  (we can see here callback parameter)

2)http://<server>/<web application>/proxy.ashx/execute?http://<server>:<port>/arcgis/rest/services/Modeling/SetAsCurrent/GPServer/SetAsCurrent=&f=json&JobID=j8758a77f9c6245ab8c86646143683b30   (you can see how the request to proxy.ashx has changed)

What can be done with this error? Try a different way to consume geoprocessing service through web (without using esri.tasks.Geoprocessor)??
0 Kudos
RichardWatson
Deactivated User
Here is a link I found which has an example which uses a different approach to specifying the proxy page:

http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/arcgis/help/jssamples_start.htm#jssa...
0 Kudos
nicogis
MVP Alum

In 10.3.x you can use the custom soi (Server Object Interceptor) . See page 8 in http://proceedings.esri.com/library/userconf/proc14/tech-workshops/tw_689.pdf .

0 Kudos