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]

J2EE Web services in Geronimo, Part 1: JAX-RPC service endpoints, EJB endpoints, and client APIs

Stefan Schmidt (geronimo@stsmedia.net), Ph.D. candidate, Developer and Author
Stefan Schmidt is a Ph.D. student specializing in enterprise development and conception, distributed systems, and Web services technologies. He works as a tutor on subjects such as advanced Internet technologies and distributed computing architecture.

Summary:  Learn how to incorporate Web services into a classic Java™ 2 Platform, Enterprise Edition (J2EE)-based application deployed on the Apache Geronimo application server. Extending the BookShop example application, which lets customers use a Web browser to search a database for books by category, will provide insight into the configurations required to develop Web services-enabled applications for the J2EE 1.4 platform. And by incorporating two J2EE-compliant Web services into BookShop, you'll implement an expanded architecture that addresses both service-consumer and service-provider scenarios.

View more content in this series

Date:  30 Aug 2005
Level:  Intermediate PDF:  A4 and Letter (444 KB | 37 pages)Get Adobe® Reader®

Activity:  8257 views
Comments:  

Before you start

This tutorial is Part 1 of a two-part series that explains and demonstrates the integration of enterprise Web services into J2EE running on Geronimo.

About this series

This part of the series demonstrates the integration of service-consumer and service-provider Web services into the existing J2EE-based BookShop application. The second part of the series will demonstrate several additional aspects that are likely to be required when using enterprise Web services in Geronimo: security, attachments, registry access, and logging.


About this tutorial

This tutorial will introduce you to some of the APIs required for the integration of Web services into a classic J2EE application. BookShop is a classic J2EE-based book-selling application that is deployed on Apache Geronimo, a J2EE 1.4-compliant application server. The original BookShop application lets customers search for books based on categories and is exclusively targeted at customers using a Web browser. Search results include the book title, author names, ISBN, description, and price in U.S. dollars. The application consists of a JavaServer Pages (JSP) component, a servlet, one session Enterprise JavaBean (EJB), and three entity EJBs that access a relational database. You'll learn how to extend BookShop by incorporating two J2EE-compliant Web services into the application -- one that delivers current exchange rates to let BookShop calculate book prices in multiple currencies and one that enables business-to-business (B2B) access by nonbrowser clients. The examples you'll work through demonstrate both service-consumer and service-provider scenarios.

The tutorial is structured as follows:

  • Extending BookShop with JAX-RPC presents an architectural overview of the BookShop example, clarifying the impact on the original application of extending it with Web services. It also gives a brief conceptual overview of the Java APIs for XML-Based Remote Procedure Call (JAX-RPC) and its integration into Geronimo.
  • Exposing Web services from BookShop demonstrates the steps required on the server side of the BookShop application to expose two Web services.
  • Web services clients in BookShop shows two ways to access the two external Web services from the J2EE-based BookShop application. It also shows a Java 2 Platform, Standard Edition (J2SE) client application that can access the Web services -- the JAX-RPC service endpoints (JSEs) and EJB endpoints -- exposed by the extended BookShop application.
  • Required deployment artifacts describes the deployment artifacts necessary for successful implementation of the extended BookShop application.
  • BookShop in action covers deployment and testing of the BookShop application on both the client and server sides.

Prerequisites

Java developers with prior experience in J2EE platform development are the primary audience for this tutorial. General knowledge of distributed programming concepts and the role of Web services in this context is beneficial but not required.


System requirements

While this tutorial's example uses MySQL for the deployment steps, you can deploy the application using Apache Derby by converting the SQL file to make it Derby compliant. Part 2 of this series provides more detail on deployment with Apache Derby.

To run the example code in this tutorial, you need to perform the following steps:

  1. Download and install the following applications and libraries:
  2. Optionally, download and install the Eclipse SDK.
  3. Make sure that the environmental variables in Table 1 are set in your shell.

Table 1. Setting the environmental variables
Variable nameRequired setting
GERONIMO_HOME Set to the root folder of your Geronimo installation
ANT_HOME Set to the root folder of your Ant installation
JAVA_HOME Set to the root folder of your Java installation
AXIS_HOME Set to the root folder of your Axis installation
AXIS_LIBRARIES Set to all libraries in AXIS_HOME/lib
PROJECT_HOME Set to the root folder of the BookShop application
PATH Include JAVA_HOME/bin, ANT_HOME/bin, JWSDP_HOME and JWSDP_HOME/jaxrpc/bin
  1. Create a database called bookshopdb in MySQL, and then run the supplied database script (etc/bookshopdb.sql) to create and populate the required relational-database tables.
  2. Create a folder in %GERONIMO_HOME%/repository/mysql/jars, and copy the mysql-connector-java-your_version_number.jar driver to this directory.
  3. Edit the geronimo-ra.xml database deployment plan found in %PROJECT_HOME%/etc by updating your exact MySQL Connector/J driver name, username, password, and server name as required.
  4. Edit the build.xml project to set the correct paths for your Geronimo and Axis installations. Also, look into %GERONIMO_HOME%/repository/tranql/rars and adjust the TranQL file name in the build.xml file accordingly.

1 of 10 | 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=Open source, SOA and Web services
ArticleID=133193
TutorialTitle=J2EE Web services in Geronimo, Part 1: JAX-RPC service endpoints, EJB endpoints, and client APIs
publish-date=08302005
author1-email=geronimo@stsmedia.net
author1-email-cc=ruterbo@us.ibm.com

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.