FeaturesPluginsDocs & SupportCommunityPartners

Web Service Application Passing Binary Data, pt 1: Overview

In this tutorial, you first create an EJB module containing a session bean that makes images available. Next, you create a web application that contains a web service, which delegates to the EJB module to retrieve the images. The web service exposes methods that can be used by clients to access the images provided by the EJB module. Then you deploy the web application and the EJB module together, as a unit, by adding them to an enterprise application and then deploying the enterprise application. At this stage, you are introduced to GlassFish testing functionality that is available from the IDE. Finally, you create a Java application that connects to the web service to display the images in an album created from Swing components. In the concluding section, you are also shown how to optimize the transfer of images from web services to clients.

Tutorials In This Trail

Content on this page applies to NetBeans IDE 6.1
  1. => Overview
  2. Creating the EJB Module
  3. Creating the Web Service
  4. Testing the Web Service
  5. Modifying the Schema and WSDL Files to Pass Binary Data
  6. Creating the Swing Client
  7. Logging and Optimizing the Web Service

Software Needed for the Tutorial

To follow this tutorial, you need the following software and resources.

Software or Resource Version Required
NetBeans IDE Web & Java EE version 6.1
Java Developer Kit (JDK) version 6 or
version 5
Java EE-compliant web or application server Tomcat web server 6.0 and/or
GlassFish application server v2
Pictures used in this tutorial rose.jpg
sunflower.jpg
aster.jpg
honeysuckle.jpg

Both Tomcat and GlassFish can be installed with the Web and Java EE distribution of NetBeans IDE. Alternatively, you can visit the GlassFish downloads page or the Apache Tomcat downloads page.

Optionally, for troubleshooting purposes, you can download the completed sample and inspect the sources.

At the end of this tutorial, you will have a running Java Swing application that consumes the EJB module's images via a web service, with the result displayed below. JFrame showing all flower images passed from web service

Next step:

Creating the EJB Module


See Also

For background information prior to using this trail, see the following resources:

To send comments and suggestions, get support, and keep informed on the latest developments on the NetBeans IDE Java EE development features, join the mailing list.

Companion
Projects:
MySQL Database Server   Open JDK: an Open SourceJDK   GlassFish Community: an Open Source Application Server    Mobile & Embedded Community    Open Solaris   java.net - The Source for Java Technology Collaboration   Virtual Box - full virtualizer  Open ESB - The Open Enterprise Service Bus Powered by