OpenLaszlo on GlassFish
This document describes steps to install OpenLaszlo on GlassFish. It demonstrates a simple web service developed on GlassFish using Netbeans invoked through a front end developed on OpenLaszlo.
About OpenLaszlo
OpenLaszlo is an open source platform for creating zero-install web applications with the user interface capabilities of desktop client software.
OpenLaszlo is write once run everywhere. An OpenLaszlo application developed on one machine will run on all leading Web browsers on all leading desktop operating systems.
The sample application develops a simple HelloWebService that is deployed on GlassFish. The Web Service Client front end is built using OpenLaszlo library. The front end replicates a functionality currently present in GlassFish that of invoking a Web Service from a test page in Admin GUI. The OpenLaszlo front end invokes the web service and shows the return value in a pop up alert box. The front end also allows us to change the color of the web page.
OpenLaszlo (as we have seen in the installation step) is deployed on GlassFish.
Developing Sample WebService on GlassFish.
- Download the glassfish-samples package to get a simple web service sample. Install it. Instructions are on the GlassFish Samples Page GlassFish Samples Page
- Set javaee.home in bp-project/build.properties.
- Open the hello-jaxws sample under javaee5/webservices/. Glassfish-samples bundles as a Netbeans project (Though for this example you do not need Netbeans).
- By default, the samples web service is a document oriented web service. To "RPC" enable it, add
@javax.jws.soap.SOAPBinding(style=javax.jws.soap.SOAPBinding.Style.RPC) on the webservice. The code for the web service is shown below:
package endpoint;
import javax.jws.WebService;
import javax.jws.soap.*;
@WebService
@javax.jws.soap.SOAPBinding(style=javax.jws.soap.SOAPBinding.Style.RPC)
public class Hello
{
public String getHello(String name)
{
return "Hello " + name + "!";
}
}
- Deploy the web service. Run the following command in the glassfish-samples workspace.
ant compile-deploy-service
- Go to Admin GUI->Web Services->Hello to test if the web service is deployed successfully.
Deploying the OpenLaszlo Web Service client
- OpenLaszlo currently does not have an uploader functionality that allows us to upload scripts into OpenLaszlo. Hence we will need to go into the internals of the deployed OpenLaszlo application to deploy the Web Service Client.
- Download the attached gf-samples.jar file and unjar it under glassfish/domains/domain1/applications/j2ee-modules/openlaszlo-3.
- The gf-samples.jar has a file called webservice.lzx that has the code for the web service OpenLaszlo client. It is not attached here due to wiki formatting issues.
- Exercise the web service client in a browser window.
http://localhost:8080/openlaszlo-3/gf-samples/webservice.lzx
- You can preview the application look and feel under the SnapShot tab.
- Webservice.lzx first loads a splash screen :-), it loads up the deployed webservice (you will have to change webservice.lzx to replace dhoom by your host name), invokes the web service and shows the result in a pop up box. Finally it, loads a drop down that allows you to change the color of the web page.
- Web Service Client Pre Invoke Snap Shot.
- Web Service Client Post Invoke Snap Shot.
Access Count: Plugin insertion failed: Plugin failed
This page (revision-14) was last changed on
16-Oct-07 11:04 AM, -0700
by JohnClingan.
This page was created on
23-Aug-06 14:56 PM, -0700 by HarpreetSingh.
More info...
| Version |
Date |
Author |
Size |
Changes ... |
|
14
|
16-Oct-07 11:04 AM, -0700
|
JohnClingan |
5621 |
to previous
|
|
13
|
25-Sep-07 16:36 PM, -0700
|
PasgeTzela |
5649 |
to previous
|
to last
|
|
12
|
25-Sep-07 16:35 PM, -0700
|
TreltBasac |
5640 |
to previous
|
to last
|
|
11
|
25-Sep-07 09:19 AM, -0700
|
LatrvItroc |
5629 |
to previous
|
to last
|
|
10
|
12-Sep-06 06:11 AM, -0700
|
EduardoPelegriLlopart |
5621 |
to previous
|
to last
|
|
9
|
23-Aug-06 18:46 PM, -0700
|
HarpreetSingh |
5549 |
to previous
|
to last
|
|
8
|
23-Aug-06 18:35 PM, -0700
|
HarpreetSingh |
5300 |
to previous
|
to last
|
|
7
|
23-Aug-06 17:44 PM, -0700
|
HarpreetSingh |
4928 |
to previous
|
to last
|
|
6
|
23-Aug-06 17:43 PM, -0700
|
HarpreetSingh |
4926 |
to previous
|
to last
|
|
5
|
23-Aug-06 17:39 PM, -0700
|
HarpreetSingh |
4564 |
to previous
|
to last
|
|
4
|
23-Aug-06 16:56 PM, -0700
|
HarpreetSingh |
3586 |
to previous
|
to last
|
|
3
|
23-Aug-06 16:53 PM, -0700
|
HarpreetSingh |
3404 |
to previous
|
to last
|
|
2
|
23-Aug-06 16:41 PM, -0700
|
HarpreetSingh |
1922 |
to previous
|
to last
|
|
1
|
23-Aug-06 14:56 PM, -0700
|
HarpreetSingh |
1592 |
to last
|