Hello World Asynchronous Demo using Document/Literal Style
==========================================================

This demo illustrates the use of the JAX-WS asynchronous invocation model. For 
details, see the the JAX-WS 2.0 specification at:

   http://jcp.org/aboutJava/communityProcess/pfd/jsr224/index.html


The asynchronous model allows the client thread to continue after making a 
two-way invocation without being blocked while awaiting a response from the 
server. Once the response is available, it is delivered to the client 
application asynchronously using one of two alternative approaches:

- Callback: the client implements the javax.xml.ws.AsyncHandler interface to 
accept notification of the response availability

- Polling: the client periodically polls a javax.xml.ws.Response instance to 
check whether the response is available

This demo illustrates both approaches.

Additional methods are generated on the Service Endpoint Interface (SEI) 
to provide this asynchrony, named by convention with the suffix "Async".

As many applications do not require this functionality, the asynchronous 
variants of the SEI methods are omitted by default to avoid polluting the SEI 
with unnecessary baggage. In order to enable generation of these methods, a 
bindings file (wsdl/async_bindings.xml) is passed to the wsdl2java generator.

Please review the README in the samples directory before continuing.



Prerequisite
------------

$SUBSTITUTE_PREREQ$


Building and running the demo using ant
---------------------------------------

From the samples/hello_world_async directory, use the following 
commands to build and run the demo on either UNIX or Windows:

  ant build
  ant server
  ant client
    
To remove the code generated from the WSDL file and the .class files, run:

  ant clean



Building the demo using wsdl2java and javac
-------------------------------------------

From the samples/hello_world_async directory, create the target directory 
build/classes and then generate code from the WSDL file as follows.

For UNIX:

  mkdir -p build/classes
  wsdl2java -d build/classes -b ./wsdl/async_binding.xml -compile ./wsdl/hello_world_async.wsdl

For Windows:

  mkdir build\classes
    Must use back slashes.
  wsdl2java -d build\classes -b .\wsdl\async_binding.xml -compile .\wsdl\hello_world_async.wsdl
    May use either forward or back slashes.

Now compile the client and server applications with the commands:

For UNIX:
  
  export CLASSPATH=$CLASSPATH:./build/classes
  javac -d build/classes src/demo/hw/client/*.java
  javac -d build/classes src/demo/hw/server/*.java

For Windows:

  set classpath=%classpath%;.\build\classes
  javac -d build\classes src\demo\hw\client\*.java
  javac -d build\classes src\demo\hw\server\*.java



Running the demo using java
---------------------------

From the samples/hello_world_async directory run the commands, entered on a
single command line:

For UNIX (must use forward slashes):
    java -Djava.util.logging.config.file=$$SUBSTITUTE_HOME$/etc/logging.properties
         demo.hw.server.Server &

    java -Djava.util.logging.config.file=$$SUBSTITUTE_HOME$/etc/logging.properties
         demo.hw.client.Client ./wsdl/hello_world_async.wsdl

The server process starts in the background. After running the client, use the 
kill command to terminate the server process.

For Windows (use either forward or backslashes):

  start 
    java -Djava.util.logging.config.file=%$SUBSTITUTE_HOME$%\etc\logging.properties
         demo.hw.server.Server

    java -Djava.util.logging.config.file=%$SUBSTITUTE_HOME$%\etc\logging.properties
       demo.hw.client.Client .\wsdl\hello_world_async.wsdl

A new command windows opens for the server process. After running the client, 
terminate the server process by issuing Ctrl-C in its command window.
