Demonstrates the use of a handler to manipulate SOAP Headers elements. The web service is running off a Stateless Session Bean (EJB 2.1).
Quick StartEnsure that you have installed the required software and set up your environment. You must have OC4J running. If it is not running on localhost, port 8888, you'll have to modify the ANT script (build.xml) to use the correct host and port to your server.
Once you have the server configured and running, just type ant from the handlerchain directory. The service artifacts and implementation class will be compiled and placed into a WAR which is then placed into an EAR. The EAR will be deployed to OC4J. Next the stubs and client will be compiled. Finally the service will be invoked by the client and you should see the output both in the server's message output and on the stdout of the client.
Step By StepAnt tasks have been configured for easy running of this demo.
To create a deployable application, type.
% ant gen-serviceThis should result in a j2ee webservices compliant application file: dist/helloService-ejb.ear.
To deploy and bind the application.
% ant deploy-demo
Visit the http test page by going to http://localhost:8888/creditService/creditService to make sure that the application has been deployed properly.
In this step you will generate the stubs for the service. A client application uses a stub to invoke operations on a remote service. Examine the file client-config.xml. This is the configuration file that the WebServices Assembler (WSA) tool uses to generate the stubs. To generate the stubs type: ant gen-stubs. The source for the stubs will be placed in build/src/client.
To run the client, issue:
% ant run-demoYou should see a result like :
"Congratulations John !
You are approved for a new Credit Card !! ...."
%java -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog -Dorg.apache.commons.logging.simplelog.defaultlog=trace -jar oc4j.jar