Build SOIs using Eclipse
This topic describes how to create, build, and deploy a server object interceptor (SOI) under the Maven framework using Eclipse. 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 a SOI using Eclipse, complete the following steps:
Ensure that ArcGIS Enterprise SDK, Java, and Maven are all installed on your development environment. See more details in the Installation section.
Open Eclipse and select File > New > Maven Project. The New Maven Project wizard appears.
Uncheck Create a simple project (skip archetype selection) and click Next.
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 click OK:
10.8.1for 10.8.1 SDK)
soi-archetypeis now added. Select this archetype and click Next.
Enter the information in the parameters below and click Finish:
- Group Id — entsdksamples.soi
- Artifact Id — SimpleSOI
- Package — entsdksamples.soi
- soiName — JavaSimpleMapSOI
- serviceType — Leave the default value
MapService. Setting serviceType to
ImageServicewill result in an image service SOI, which is supported since 10.8.1.
A new SOI project is created now. You should see the
entsdksamples.soepackage and the
JavaSimpleMapSOIclass under the
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 SOE project by using either the Maven Build tool or the Terminal view in Eclipse.
As the project is created from
soi-archetype, it automatically loads the boilerplate code that implements a ready-to-use SOI. For now, we can just customize the
description of the SOI and leave the rest of the code as is.
Open the SOI class
JavaSimpleMapSOI, located in the
src\main\javafolder (see A in the example above).
Java Simple Map SOI(see B).
Follow these steps to build the project.
To build the project using Maven Build, do the following:
a. Right-click the project and choose Run As > Run Configuration.
b. Double-click Maven Build from the list on the left side of the Run Configuration wizard.
c. The New_configuration wizard appears. Click Workspace to set the current project as the workspace. Type
clean installin Goals, click Apply, and click Run.
d. The project is built successfully, with detailed log messages in the Console view (see C).
Alternatively, to build the project in the Terminal view, do the following:
a. Click the Terminal tab at the bottom of Eclipse (see D). If you can't find this tab, you need to add this view from Window > Show View > Other > Terminal (see E).
b. On the Terminal view, click Open a Terminal, which is a blue button on the right. A terminal is activated.
c. Ensure the current directory is pointing to the project's base 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 F). If you don't see the file, right-click and refresh the
targetfolder or the project.
If you would like to add third-party libraries as dependencies, you can add them to the project's
pom.xml (see G). 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.