Getting Started
- The plugin does not include the Globus Toolkit. You must install it separately. Currently, the supported version is 4.0:
http://www.globustoolkit.org/
- If you don't have Eclipse installed in your system, make sure you
download and install the latest stable release of Eclipse 3.0 (not
Eclipse 2.x)
http://download.eclipse.org/eclipse/downloads/index.php
- Download the binary release of the plugin. You must download the version that matches
the JDK you used to compile GT4. In other words, if you download the JDK1.4 version of the plugin, it will not work on a GT4 compiled with JDK1.5.
- Install it by unzipping the file in your Eclipse directory. If
Eclipse is already running when you do this, you should restart
Eclipse. Once the plug-in is installed, you will be asked the location
of the GT4 directory. You will be asked this only once, although you
can change it later on in the GT4 Plugin preferences.

Creating a new project and service
-
Create a new GT4 project by clicking on File -> New -> Project... -> GT4 Project
-
You should see the New Project dialog:

You will be asked to fill in the following fields:
- Project Name: This is a brief description of the project. For example, ExampleProject. [Note: the project name currently cannot have spaces in it. This will be fixed in the second alpha]
- Create First Service: Check this if you want to create a new service right away.
- If you chose to create a service, you will see the New Service window:

You will be asked the following information:
-
Base Package: This is the base package where the implementation and the
WSDD file will be placed. It is also the package where the stub
packages will be placed. For example, org.globus.gt4ide.example
Base Namespace: This is the base of the target namespace of the (G)WSDL
file. It must be a valid URI. For example
http://www.globus.org/gt4ide/example/
(The full namespace is created in combination with the next field)
-
Name of Interface/PortType: This is actually a name from which a lot of
other names will be derived. For example, if you enter Math the name of
the portType stub class will be MathPortType. This name is also
attached at the end of the Base Namespace (previous field) to form the
full namespace.
-
Service Path: URL where the service will be published. You don't need
to enter a complete URL, since all service URLs start with
http://localhost:8080/wsrf/services. In other words, you must supply
the path that comes after the base address. For example, if you enter
gt4ide/example , the full path of the service will be
http://localhost:8080/wsrf/services/gt4ide/example/MathService
-
Design Pattern?: You have two options:
-
Singleton with ServiceResourceHome
For this example, we will assume you've chosen “Singleton with
ServiceResourceHome” (the steps to follow for “Factory/Instance” are
similar)
-
Provide implementation skeleton?: The plug-in can generate a set of
basic Java files where the only thing left to do is to implement the
methods you want your service to provide. Right now, the plugin offers
only one implementation strategy:
-
Yes, using ReflectionResourceProperties
After creating the first service, your package explorer should look something like this:

Don't worry if you see an error icon in the project. This is normal,
since we haven't generated the stub files yet (they are necessary to
successfully compile the project).
Add remote operations
- Make sure you're using the Globus Toolkit perspective in Eclipse (click on the Globus logo in the top right corner of Eclipse).

- To add a remote operation, you will need to implement it in the
Service class (“MathService” in our example) like you would any other
Java method. However, you have to make sure that your method is (1)
private and (2) has a name prefixed by “do_”. For example:

- Now, we need to generate the WSDL code for this method.
Right-click on the Package Explorer, and select Globus Toolkit ->
Update WSDLs.

- You should see the following method appear magically in your Java service file:
.png)
This method is in charge of handling incoming calls to the
service, and of invoking our private implementation (“do_add”). Again,
don't worry about the error icon. Eclipse is simply complaining because
we haven't generated the stubs yet.
[You can also take a look at the WSDL file to see that the WSDL code has, in fact, been generated]
- Now, generate the stub classes by pressing the “STUBS” button in the main toolbar:

A window should briefly appear informing you of the progress of
the stub generation. You can also see the output from Ant in Eclipse's
console. - At this point, you should not get any error messages and all the Java files should compile.
Generate the GAR file
- You are now ready to generate the GAR file for your project.
Simply click on the GAR button in the main toolbar. If all goes well, a
file named NameOfYourProject.gar should pop up magically in the root of your project (in our case, “ExampleProject”).
|