Build SOIs using IntelliJ
This topic describes how to create, build, and deploy a server object interceptor (SOI) under the Maven framework using IntelliJ. It also describes how to consume the SOI from the ArcGIS Server Services Directory.
The SOI that you will create in this topic is also provided as a sample, named Simple SOI in the ArcGIS Enterprise SDK(
To create an SOI using IntelliJ, complete the following steps:
Ensure that ArcGIS Enterprise SDK, Java, and Maven are all installed on your development environment. See more details at the installation section.
Launch IntelliJ and choose Create New Project. The New Project wizard appears.
Choose Maven on the left menu. Check the Create from archetype checkbox.
soi-archetypehas already been added, skip this step.
Otherwise, click the Add Archetype button on the right, type the following values in the Add Archetype wizard, and then click OK:
10.9.0for 10.9 SDK and
10.8.1for 10.8.1 SDK)
Other SOE and SOI archetypes will also be automatically picked up and show up next time when you choose Create from archetype.
soi-archetypeis now added. Select this archetype and click Next.
Note: Ensure that Project SDK is set to use the supported JDK before you proceed.
Enter the information in the parameters below and click Next:
- Name — simplesoi
- GroupId — entsdksamples.soi
- ArtifactId — simplesoi
Click the + button on the right. Add a Maven property soiName with the value
Java. Click OK.
Simple M a p SOI
Note: You must add the soiName property, which is a required property used for the SOI's class name, otherwise the SOI project can't be built.
Ensure Maven home directory is set to use the supported Maven and the soiName property is added. Click Finish.
A new SOI project is created. You should see
Build Successon the right of the bottom Run Tool Window.
If you see any warnings, you can ignore them for now as long as the project successfully generates the
Javaclass under the
Simple M a p SOI
src\main\javafolder. You will address those warnings during project build. Continue to build the SOI project now.
Building an SOI project will package the project's classes, dependencies, and resources into a
.soe file, which can be deployed to ArcGIS Server. Since it's a Maven project, the Maven build lifecycle must be followed to build the SOI. Read more about project build.
You can build the SOI project in either the Maven tool window or the Terminal tool window.
Because the project is created from
soi-archetype, it automatically loads the boilerplate code that implements a ready-to-use SOI. For now, you can customize the
description of the SOI and leave the rest of the code as is for now.
Open the SOI class
Java, located in the
Simple M a p SOI
src\main\javafolder (see A in the example above).
Java Simple SOI(see B).
Now follow these steps to build the project.
To build the project in the Maven tool window, do the following:
a. Click the Maven tab on the right side of IntelliJ (see C).
simplesoi. You should see Lifecycle, Plugins and Dependencies listed.
c. If you don't see Dependencies, click the Reimport All Maven Projects button (see D) on the far left of the tool bar in the Maven tool window.
d. Now you should see Dependencies, and com.esri.arcgis.enterprise.sdk:arcgis-enterprise-sdk:version is listed as one of the dependencies.
e. Expand Lifecycle and click install. You can also click clean and click install for a clean build of the project.
f. The project is built successfully with detailed log messages in the Run tool window (see E).
Alternatively, to build the project in the Terminal tool window, do the following:
a. Click the Terminal tab at the bottom of IntelliJ (see F).
b. Ensure the directory is pointing to the project's root directory.
mvn clean install. This command does a clean build of the project, and you should see
Once the build finishes, a new folder named
targetappears in the project's base directory, and you can find the SOI file
simplesoi.soein this folder (see G).
If you would like to add third-party libraries as dependencies, you can add them to the project's
pom.xml (see H). The POM contains project configuration information, such as the Java compiler (JDK) used, plug-ins used, project's dependencies, and project's version. Learn more about POM dependency management.
To deploy and test the Simple SOI's functions, follow the instructions at Audit requests in SOIs.