This example demonstrates a servlet acting as a J2EE client consuming a remote
Web Service.
Ensure 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.
In addition to having the server configured and running, you also need to
make sure that the Web Service referenced by this example has been deployed
and is running. The end point address of the service is http://localhost:8888/hello/HelloService.
This can be achieved by deploying the demo
Once you have the server configured and running, just type ant from the
Step 1 - Assemble the application
To create a deployable application, type: ant assemble.
This results in a J2EE Web Services compliant application file: dist/consumerWeb.jar.
Step 2 - Deploy the application
To deploy the application, type: ant deploy-demo.
Step 3 - Run the Client
To run the client, type: ant run. You should see output such as the following.
client-run: run-demo: [echo] Please fire up your browser and enter the following address localhost:8888/consumerWeb/consumer [get] Getting: http://localhost:8888/consumerWeb/consumerCheck out ./result.html, you should see:
"result from service :Hello Servlet Consumer !"
or you can point your browser to the following URL: http://localhost:8888/consumerWeb/consumer.
Note: You need to make sure that your application server is up and the web site configured before attempting to build.