Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

Robust, maintainable client solutions

Bill Harper (bharper@solutionst.com), Technology consultant
Bill Harper is a technology consultant focusing on custom, elegant software for research and business. Educated at a technology school in Cambridge, Massachusetts, he has spent the last two decades improving customer productivity with a focus on fault-tolerant, database solutions.

Summary:  This tutorial reveals the nitty-gritty details of using Java 2 Standard Edition (J2SE) clients deployed with Java Web Start (JWS) to access Web services running on IBM Websphere Application Server.

Date:  15 Mar 2004
Level:  Advanced PDF:  A4 and Letter (852 KB | 35 pages)Get Adobe® Reader®

Activity:  1728 views
Comments:  

Introduction

Why use J2SE clients to access Web services?

Jave 2 Standard Edition (J2SE) provides a great set of tools to build a rich graphical user interface (GUI). Unfortunately, client-server model J2SE programs have historically come with a lot of baggage:

  • They were diffcult to deploy.
  • They consumed lots of database server resources with their Java Database Connectivity (JDBC) driver connections.
  • They relied on the database server security model or required an application-wide password on the client machine to use application-specific security.

Java Web Start and Web services enable a new application architecture with the rich GUI of a so-called fat client without the headaches. Java Web Start takes care of all the installation, deployment, and update problems over the Web. Web services technology takes care of the database server resources by concentrating database connections for hundreds of users in the Web service. Security models are simpler because the Web service logic is now able to use any resource available to a Java program running in the server environment.

Take this tutorial if you want to learn how to connect a J2SE client to Web services running on an IBM(R) WebSphere(R) Studio platform or you just want to learn how to deploy a J2SE client from WebSphere Studio using Java Web Start.


Driving requirements

Like all practical tutorials, this one starts with real-world requirements for a manufacturing client. The gist of the application shows machine and employee work schedules at a micro-level. The application replaces magnets and printed cards on a white board. Key technical requirements are:

  1. Ensure that the application can continue to display schedules even if the server is inaccessible for a period of several hours.
  2. Provide for centralized, unattended deployment to any authorized user.
  3. Read and update data in an IBM iSeries Server database.
  4. Use only currently supported server technologies to delay the application becoming out-of-date.
  5. Develop the application within the Websphere Studio Application Developer environment for ease of future maintenance.

The first two requirements suggest the use of a Java 2 Standard Edition (J2SE) client with Java Web Start technology. The J2SE client can safe-store data on the client computer during server outages. Java Web Start provides for centralized, automated deployment. The third requirement suggested two alternative client-server architectures -- Java Database Connectivity (JDBC) and Web services. Both architectures have been deployed in this client environment, with greater success using Web services. One application runs on Sharp Zaurus Personal Digital Assistant (PDA) devices using KSoap for XML parsing. The other Web services application uses Apache Axis on both client and server to implement remote method invocation. The client is a J2SE client which is also used in stand-alone mode.

Research into the iSeries Websphere Sudio platform indicated that the Apache Axis Web service implementation would not be supported in the future, and that new Web service development should use the Web Service 5.0.2 WS-I standards. The fourth requirement mandated the use of the 5.0.2 WS-I standards. Initial testing within the development tool showed great promise for a smooth development path until the first test deployment. Unfortunately, a J2SE client developed using the IBM WSDK V5.1 tools will not run as a standard client outside of a J2EE container. Implementing a full-blown J2EE application client was ruled about because of the complexity of J2EE technology for a simple white board application. In addition, the J2EE standard of configuring the client from the server violated the first requirement to display data after client restart without use of the server.

Is there a way to use a different implementation of Java Web Services to inter-operate with the iSeries Server? Yes, the Sun Java Web Services Developer Pack contained different implementations of J2SE client code generation and run-time libraries which will inter-operate with the Websphere Application Server. This tutorial will guide you through all the steps to create and deploy Web services and J2SE clients using both IBM and Sun tools to build Java Web Start applications which inter-operate with IBM Websphere Application Server Test Environment inside IBM Websphere Studio Application Developer.


Tutorial Goals

The goal of this tutorial is to reveal the nitty-gritty details of using Java 2 Standard Edition (J2SE) clients, deployed with Java Web Start (JWS), to access Web services running on Application Server. These revelations show how to:

  • Build Web services from Java Beans in Application Developer
  • Change your Device Developer environment to use JSDK 1.4.x while retaining the ability to run the original IBM J2SDK version 1.3.
  • Use Sun's Java Web Services Developer Pack (JWSDP) to generate J2SE client artifacts from an IBM Web services deployment language (WSDL) file.
  • Prepare and deploy the J2SE client using JWS from the Application Server.

Prerequisites

Before beginning this tutorial, you should understand Java programming, the Device Developer development environment, and Web services architecture concepts. This tutorial was developed on a Windows XP workstation and assumes development and deployment in Windows environments. On other platforms, your mileage may vary. Your development workstation should have the following installed components:

  • Sun's Java 1.4.2 or greater Java 2 Software Development Kit (J2SDK) from java.sun.com. For smooth operation of Ant build tasks, be sure to install the J2SDK into the root of your C: drive. Do not accept the default of installing under the Program Files directory.
  • Sun's Java Runtime Environment (JRE) on the client computer to match the J2SDK. The installation of any Java 1.4 JRE on a client computer should install the Java Web Start client. The server and client computer can be the same machine.
  • IBM Web Services Development Kit Version 5.1 (WSDK 5.1) from IBM developerWorks.
  • Sun's Java Web Services Developer Pack Version 1.3 (JWSDP 1.3) from java.sun.com.

During this tutorial, you will create a simple set of Web services to test inter-operability. The sample services implement both simple and complex request and return types in order to demonstrate practical use of Web services technology. In the interests of simplicity, you will generate the Web services for this tutorial from simple Java beans with no database access.

The work for this tutorial will be done in two workspaces -- one using Java SDK 1.3.1 as shipped by IBM and one Device Developer workspace using Sun's Java SDK 1.4.2. Two workspaces are required because each vendor's Web services tooling requires its expected run-time environment. The use of two workspaces means the running of two separate Device Developer processes.

Now that you have everything you need, select your favorite starting point from:

  • From Beans to Web services
  • Changing the Device Developer Java SDK
  • Build a J2SE WSI Client
  • Deploy the client with Java Web Start

1 of 8 | Next

Comments



Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=SOA and Web services
ArticleID=137532
TutorialTitle=Robust, maintainable client solutions
publish-date=03152004
author1-email=bharper@solutionst.com
author1-email-cc=

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere).

My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Try IBM PureSystems. No charge.