Tuesday, August 16, 2005

What Time Is IT? Date GUI DBE Service

Files: UCEDateGUIExample.zip

In the last tutorial we run a simple DBE service using the ExE. The tutorial provided the basis for deploying and consuming the service, and also it provided instructions on how to install and configure an ExE DBE node.

Based on the previous tutorial, this one will implement the service with Graphical User Interface (GUI). This tutorial is based on the one produced by our Regional Catalyst partners ITA in Aragon (Spain). This tutorial focuses on getting the service quickly deployed and consumed.

The tutorial has 4 parts:
  • Requirements
  • Deploying the Service
  • Running/Testing the Service
  • Conclusions

Requirements
If you haven’t installed the servENT distribution yet, please follow the details in the previous tutorial to install and configure the servENT. We assume that you are using servENT version 1.4. In this example the service is self-contained and all the code necessary to run the service is part of the service itself, including the graphical user interface.

Deploying the Service
Download the UCEDateGUIExample.zip file and unzip it to a suitable directory. As with the previous tutorial, once the servENT is started, we can deploy our service by using the deploy.html file within that directory. Open the deploy.html file and upload the deployThis.dar file and press “go”. If everything went OK you should see a “Service Registered” message/page, and browsing to the services pages of the FADA node should display the service smid (http://localhost:2002/services)

Running/Testing the Service
In this case, we can run/test the service in two different ways, as a service embedded in a (Java) Applet or as a standalone DBE service.To test the service as an Applet, you will need to type this URL on your browser:
http://_servent_ip_:_servent_port_/CLIENT/show?entries=_entry_
where:
_servent_ip_ is the host where the servENT is running, typically localhost
_servent_port_ is the port where servENT is running, typically 2728 (default)
_entry_ is the name of the service (service smid as described in servent.props)

In our case, our URL should look like: http://localhost:2728/CLIENT/show?entries=UCEDateServiceGUI

When you load the URL, an Applet should open and run the service. Running the service as an Applet requires that you have your browser properly configured to support Java Applets.



To run the service as a standalone java class, copy the file “client.bat” (included in UCEDateGUIExample.zip ) under your servENT bin directory and execute the command (within that directory)

\bin\Client.bat UCEDateServiceGUI

More or less immediately, you should see a window like this.




If you click on the “get date” button, you should obtain a new window with a dialog box showing the date. In this case, our service contains both the user interface and the service.

Conclusions
The previous tutorial demonstrated how to deploy and consume a simple service. On this tutorial we have replicated the functionality of the previous service and included a GUI that also gets deployed and consumed together with the real service. In both cases, the service consumer (client) had no knowledge of the protocol, or the real service location*.

For more information, look at the source code included on this example and also at the servENT users guide, available at the SourceForge site.

http://swallow.sourceforge.net/distribution/docs/user_guide.html

* For simplicity, we have used only localhost

0 Comments:

Post a Comment

<< Home