The REST API can be browsed through a web browser at http://<host>:<port>/fmerest/.
Setting up a Java Project Using Eclipse and Apache HTTP Client
You will also need the following dependencies:
commons-codec
commons-logging
junit
Refer to http://hc.apache.org/httpclient-3.x/dependencies.html for details.
You should see in the lib folder containing several JAR files.
The names may be different depending on version. You may also select all JARs in the folder.
This, for example, can be done with the following line of code:
import org.apache.commons.httpclient.*;
Running the API Sample demo
A sample command-line demo application illustrating the use of the FME Server REST API is available in Java and JavaScript versions. The JavaScript version, however, has limited functionality due to security issues.
This demo can be used to ensure that everything has been setup properly, and contains code that may be useful for your development process. (More in-depth coverage can be found in the later sections.)
The Java command-line application requires two parameters: the FME Server host and FME Server port.
The Java source code was developed using Java JDK V1.5 and is located in:
<FMEServerDir>\Server\sdk\doc\java\FMEServerRESTAPIdemo.java
Add the source code to your project, and run.
Usage: FMEServerRESTAPIDemo <fmeServerHost> <fmeServerPort>
Note: <fmeServerHost> represents the name of the host on which the Web Server is running.
<fmeServerPort> represents the TCP/IP port number the Web Server is listening on for requests. The default value is 80 and this is usually correct for most FME Server installations.