import COM.safe.fmeserver.api.*;
A sample command-line demo application illustrating the use of the FME Server API is available in C++, .Net, and Java 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.)
If security is enabled for FME Server, your application must provide a client ID that has been registered with FME Server. The client ID for the demo application is app_apidemo. By default, the demo's client ID is not registered with FME Server, and you must register the client ID. (See Resources for more information.)
The command-line application requires two parameters: the FME Server host and FME Server port.
Note: <fmeServerHost> represents the name of the host on which the FME Server is running.
<fmeServerPort> represents the TCP/IP port number the FME Server is listening on for requests. The default value is 7071 and this is usually correct for most FME Server installations.
The Java source code was developed using Java JDK V1.5 and is located in:
<FMEServerDir>\Server\sdk\samples\apidemo\java\FMEServerAPIDemo.java
...using the new project from the previous section
Add the source code to your project, and run.
...independently or with another IDE
To compile:
<jdkInstallDir>\bin\javac.exe FMEServerAPIDemo.java
To run:
<jdkInstallDir>\bin\java.exe -cp .;..\..\..\Java\fmeserverapi.jar;..\..\..\Java\jaxen-1.1.1.jar;..\..\..\Java\dom4j-1.6.1.jar FMEServerAPIDemo <fmeServerHost> <fmeServerPort>