You are here: FME Server Developer's Guide > Developing with the Web Services > FME Server Transformation Services > Java Quick Start

Java Quick Start

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.

API Files

Setting up a Java Project Using Eclipse and Apache HTTP Client

  1. Visit http://hc.apache.org to download the Apache HTTP Client.
  2. You will also need the following dependencies:
  3. Refer to http://hc.apache.org/httpclient-3.x/dependencies.html for details.

  4. Unzip the downloaded file.
  5. You should see a lib folder containing several JAR files.

  6. Start Eclipse.
  7. Choose File > New > Project, and select Java Project.
  8. Enter FMEServerWebServicesDemo for the project name.
  9. In the Java Settings dialog under the Libraries tab, click on Add External JARs button.
  10. Select the commons-httpclient, commons-codec, and commons-logging JAR files in the Apache HTTP Client lib folder to add to your project.
  11. The names may be different depending on version. You may also select all JARs in the folder.

  12. Now add a Java Class file, and import the Apache HTTP Client namespace.
  13. 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 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>

Safe Software Inc. www.safe.com