INBOUND CONNECTION $SUBSTITUTE_NAME_UPPER$ J2EE DEMO
==================================
==================================


This demo shows how to expose an Enterprise Java Bean over SOAP/HTTP using 
$SUBSTITUTE_NAME_UPPER$. 


Running the Demo
================

To run this demo application:

    . Set JBoss environment
    . Set $SUBSTITUTE_NAME_UPPER$ environment
    . Build $SUBSTITUTE_NAME_UPPER$ J2EE Connector rar file
    . Launch the application server
    . Deploy the $SUBSTITUTE_NAME_UPPER$ J2EE Connector 
    . Build the demo
    . Deploy the EJB application to the application server
    . Activate the EJB Web Services facade
    . Access the EJB using a Web Services client


Set Jboss environment
=====================
 (Unix) % export JBOSS_HOME=<jboss-home>
 (Windows) > set JBOSS_HOME=<jboss-home>


Set $SUBSTITUTE_NAME_UPPER$ environment
=====================

$SUBSTITUTE_PREREQ$


Build $SUBSTITUTE_NAME_UPPER$ J2EE Connector rar file
=================================
  (Unix)    % ant generate.rar
  (Windows) > ant generate.rar

This target updates the jboss endorsed directory first, then copies the 
following files to the $JBOSS_HOME/lib/endorsed directory:

- activation-1.1.jar
- jaxb-api-2.0.jar
- jaxb-impl-2.0.3.jar
- jaxb-xjc-2.0.3.jar
- stax-api-1.0.1.jar
- jsr181-api-1.0-MR1.jar
- saaj-api-1.3.jar
- saaj-impl-1.3.jar
 


Launch the application server
=============================

    The demo requires an application server. Make sure you have a
    running instance of an application server. 

Deploy the $SUBSTITUTE_NAME_UPPER$ J2EE Connector
===============================

    You must deploy the $SUBSTITUTE_NAME_UPPER$ J2EE Connector to the application
    server before running the demo.  A single resource adapter deployment is 
    shared by all of the demos, so you need to do this only once.


    How you deploy the $SUBSTITUTE_NAME_UPPER$ J2EE Connector depends on your 
    application server. Please consult your vendor documentation on connector 
    deployment. Here are basic instructions to deploy the connector in JBoss 
    application servers.

  (Unix)    % ant deploy.cxf.rar
  (Windows) > ant deploy.cxf.rar

Or copy the connector RAR from its location in the $SUBSTITUTE_NAME_UPPER$ installation to
the JBoss deployment directory.

  (Unix)    % cd $$SUBSTITUTE_HOME$/lib/
            % cp cxf.rar \ 
              $JBOSS_HOME/server/default/deploy

  (Windows) > cd %$SUBSTITUTE_HOME$%\lib\
            > copy cxf.rar 
              %JBOSS_HOME%\server\default\deploy

Copy the cxf_j2ee_1_5-ds.xml file to the JBoss deployment directory.

  (Unix)    % cp ./etc/cxfj2ee_1_5-ds.xml $JBOSS_HOME/server/default/deploy

  (Windows) > copy .\etc\cxfj2ee_1_5-ds.xml 
                %JBOSS_HOME%\server\default\deploy


Building the Demo
=================

Building the demo requires that there is a JDK available and that the
$SUBSTITUTE_NAME_UPPER$ environment is correctly set. 

The demo may be built from the directory 
inbound.

Issue the command:

  (Unix)    % ant
  (Windows) > ant



Deploying the demo EJB application
==================================

How you deploy an EJB application depends on your application server. 
Please consult your vender documentation on application deployment. Here are 
basic instructions to deploy the demo application for JBoss application servers.

  (Unix)    % ant deploy.ejb.jar
  (Windows) > ant deploy.ejb.jar

Or copy the EJB archive ./j2ee-archives/greeterejb.jar to the JBoss deployment 
directory.
  
  (Unix)    % cp ./j2ee-archives/greeterejb.jar \ 
              $JBOSS_HOME/server/default/deploy
  (Windows) > copy .\j2ee-archives\greeterejb.jar 
              %JBOSS_HOME%\server\default\deploy

Activate the EJB Web Services facade
====================================

Exposing EJBs as Web Services in the $SUBSTITUTE_NAME_UPPER$ J2EE Connector is
controlled by an ejb_servants.properties file, located in $$SUBSTITUTE_HOME$/etc, 
by default. The ant build script for this demo automatically updates this file, 
so ensure that you have write permissions for this file:

    ant activate

You can configure the location of this file using the EJBServantPropertiesURL 
property.

See the documentation for further information on the contents of the properties 
file and how it is used. 

Note: The $SUBSTITUTE_NAME_UPPER$ J2EE Connector checks this file every 30 seconds
so you must wait this length of time before running the client. 


Running the Demo
================


Once the resource adapter and the EJB application have been deployed, run the 
client using the following command:

    ant client 

This launches a $SUBSTITUTE_NAME_UPPER$ Java Client which contacts the Web 
service-enabled EJB. 
