JAX-WS 2.0 Beta
Samples Documentation

Java APIs for XML Web Services 2.0 is developed as JSR 224 under the Java Community Process (JCP). This document explains the samples that are bundled along with the Early Access Standards Implementation of JAX-WS 2.0.

1.0 Directory Structure

This section explains the directory structure of the samples directory in the bundle:

docs

index.html, this file

fromjava

Demonstrates how to build, deploy, and invoke a simple Web service starting from a Java service endpoint implementation using annotations.

fromjavahandler 

Same as fromjava sample but with a simple logging handler on the client and server.

fromwsdl

Demonstrates how to build, deploy, and invoke a simple Web service starting from a WSDL using external customizations.

fromwsdlhandler 

Same as fromwsdl sample but with a simple logging handler on the client and server.

dispatch

Demonstrates how to dynamically invoke web service endpoints.

provider

Demonstrates how to build, deploy, and invoke javax.xml.ws.Provider based Web service endpoint.

annotations

Same as fromjava but shows how to specify a different parameter name, operation name, targetNamespace, and other similar features.

async

Demonstrates how to generate async operations in a client SEI from a WSDL and invoke it from the client application.

external-customize

Demonstrates how a client client application can customize a published WSDL using external binding  file.

inline-customize

Demonstrates how a client application and server endpoint can be generated from a WSDL with embedded binding declarations.

mtom

Demonstrates how to enable MTOM and swaRef.

mtom-soap12

Same as mtom sample but shows how to specify SOAP 1.2 binding.

fromjava-soap12

Same as fromjava sample but shows how to specify SOAP 1.2 binding.

fromwsdl-soap12

Same as fromwsdl sample but shows how to specify SOAP 1.2 binding.

supplychain

Same as fromjava sample but using JavaBeans as parameter and return types.
Also the service can be built and deployed using Endpoint API.

mime

Demonstrates how a MIME binding is defined in the WSDL to send wsdl:part as MIME attachments. This requires that the development model is 'starting from WSDL'.

wsimport_catalog

Demonstrates a how a WSDL and schema URI's can be resolved using catalog mechanism using wsimport ant tasks' catalog attribute and also using ant's core type xmlcatalog.

catalog

Shows the catalog capability on the client side; Catalog is used every time the implementation tries to access a resource identified by URI that is believed to contain either a WSDL document or any other document on which it depends .

restful

Shows an example of a REST Web Service implemented as a JAX-WS 2.0 Provider and accessed via a JAX-WS Dispatch client. The Request uses an HTTP GET Request Method and uses the JAX-WS MessageContext properties PATH_INFO and QUERY_STRING.

2.0 Prerequisites

Here is the list of prerequisites that needs to be met before any of the samples can be invoked:

  1. Download Java 2 Standard Edition 5.0 Update 2 or later (J2SE 5.0) from java.sun.com/j2se/1.5.0/download.jsp. Set JAVA_HOME to the J2SE 5.0 installation directory.

  2. Download Sun Java System Application Server Platform Edition 8.1 2005 Q1 UR2 (SJSAS PE 8.1 or Application Server) or later from java.sun.com/j2ee/1.4/download.html. SJSAS PE 8.1 download page has J2EE 1.4 SDK 2005Q1 UR2 available as All-In-One bundle and SJSJAS PE 8.1 available as separate bundle. Make sure that you download SJSAS PE 8.1 separate bundle only and use J2SE 5.0 as the J2SE platform for it's installation. Although the download page requires J2SE 1.4.2 SDK for SJSAS PE 8.1, J2SE 5.0 is required for JAX-WS 2.0 binaries and must be used as the J2SE platform for SJSAS PE 8.1 for the samples to work.

  3. If you have installed JAX-WS as part of JWSDP, make sure the Application Server was selected as the container when you installed JWSDP and set your PATH to use the version of Ant installed with JWSDP.

  4. If you have installed a standalone JAX-WS bundle,

    1. Set AS_HOME to point to the Application Server installation directory.

    2. Make sure that the Application Server is not running.

    3. Invoke ANT_HOME/bin/ant install from the root directory of the JAX-WS 2.0 EA2 bundle. This will install JAX-WS 2.0 bundle on the Application Server referred by AS_HOME environment variable.

    4. Download Ant 1.6.2 or later from ant.apache.org and install it, lets say this is installed in ANT_HOME. Please note that AS_HOME/bin/asant cannot be used for building and invoking the samples since JAX-RPC 1.1 implementation is baked into this version of ant script. 

3.0 Invoking the sample

Each sample can be built, deployed and invoked using the ANT_HOME/bin/ant and build.xml ant script in the root directory of the sample. Each ant script supports the following set of targets:

server

Builds and deploy the service endpoint WAR

client

Builds the client

run

Runs the client


Some samples can be built, deployed using javax.xml.ws.Endpoint API. These sample support an extra target:

server-j2se

Builds and deploys the Endpoint API based service endpoint


It is essential for the service endpoint to be deployed on Application Server before clients can be built because clients use the WSDL exposed from the service endpoint deployed in the Application Server. So please make sure that your Application Server is either running before the server target is invoked or run it after the server target is invoked. You will have to wait a few minutes for the Application Server to deploy the service endpoint correctly before building the client.

 

We appreciate your feedback, please send it to users@jax-ws.dev.java.net.