The FME Web Services API can be used by anything that can send and receive HTTP requests. However, we will be focusing on Java here.
Setting up a Java Project Using Eclipse and Apache HTTP Client
Refer to http://hc.apache.org/httpclient-3.x/dependencies.html for details.
You should see a 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.*;
A sample command-line demo application illustrating the use of the FME Server Web Service API is available in Java and JavaScript versions.
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 is located in:
<FMEServerDir>\Server\sdk\doc\java\
FMEServerWebServicesAPIDemo.java
Add the source code to your project, and run.
Usage:
FMEServerWebServicesAPIDemo<fmeServerHost><fmeServerPort>