This sample illustrates the basic framework for creating a server object interceptor (SOI). The SOI adds a message to the ArcGIS Server logs whenever a REST request is received before forwarding the request to the underlying default implementation.
Deploying the SOI from the .soe file (../SimpleSOI/target/SimpleSOI.soe
) does not require you to open a Java IDE. However, you can open the project (../SimpleSOI
) in a Java IDE, such as Eclipse or IntelliJ, to debug, modify, and recompile the SOI project.
Features
ILog.addMessage
IRESTRequestHandler.handleRESTRequest
- How to audit requests in SOIs
Sample data
Any dynamic map service published from ArcGIS Pro. This instruction uses the USA map service as the sample service to test with the SOI.
Instructions
Deploy the SOI
- Log in to ArcGIS Server Manager and click the Site tab.
- Click Extensions.
- Click Add Extension.
- Click Choose File and choose the SimpleSOI.soe file (
../SimpleSOI/target/SimpleSOI.soe
). - Click Add.
Enable the SOI on a map service
-
Make sure you have published the USA map service using ArcGIS Pro. If not, refer to USA map service
-
Log in to ArcGIS Server Manager and click the Services tab. Select USA map service and select Capabilities.
-
In the Interceptors section, select Java Simple Map SOI in the Available Interceptors box and click the right arrow button to move it to Enabled Interceptors.
-
Click the Save and Restart button to restart the service.
Test the SOI
- Set ArcGIS Server Log Level:
- Browse to ArcGIS Server Manager > Logs > View Logs page.
- Click the Settings button.
- Make sure you set Log Level to Fine (or any level below, such as Verbose or Debug). Click Save.
- Perform a REST service operation to trigger the SOI logging:
-
Open a browser and navigate to the REST services endpoint of the USA map service (URL:
http://<serverdomain>/<webadaptorname>/rest/services/USA/MapServer
). -
Scroll to the bottom of the above page and click Export Map in Supported Extensions.
This leads you to the following URL:
http://<serverdomain>/<webadaptorname>/rest/services/USA/MapServer/export?bbox=-178.85719640187426,13.522152002873426,-56.484036397641795,81.72479317856566
-
- Check ArcGIS Server logs:
- Browse to ArcGIS Server Manager > Logs > View Logs page.
- Set the Log Filter to Fine (or any level below, such as Verbose or Debug) and click Query.
- Now the SOI's log message "Request logged in SampleSOI..." for the operation accomplished in step 2 can be found: