This demo shows how overloading for Java methods is supported.
The service used here has three methods with identical names but different parameter types. The three methods each return a string which contains the method that was called and a "result" (not important for this demo but it is the number given in the parameter, increased by 10).
The Result strings look like the following:
"Called method with String parameter - result is: ..." "Called method with int parameter - result is: ..." "Sent Struct: Called method with Struct parameter - result is: ..."
In addition to the files described in Files and Directories, this demo contains:
File or directory | Description |
---|---|
src/demo/advanced/overload/server/ | Server source code |
src/demo/advanced/overload/client/ | Client source code |
You can run the demo using the "run.sh" (for UNIX) or "run.bat" (for Windows) scripts. Running the script without arguments prints out a help message on screen.
The demo can be run in two different ways:
To use Runtime Publishing, follow these steps:
Be sure that you have not started SESJ.
Compile the server classes.
Windows: run.bat make_server Linux: ./run.sh make_server
Run OverloadServer (it starts SESJ and publishes OverloadService class).
Windows: run.bat run_server Linux: ./run.sh run_server (use a new terminal)
You can look at OverloadService WSDL on 'http://localhost:6060/demo/advanced/OverloadService/wsdl' from your browser.
Make the client classes.
Windows: run.bat make_client Linux: ./run.sh make_client
Run OverloadClient (it calls OverloadService).
Windows: run.bat run_client Linux: ./run.sh run_client
If you wish to follow the progress of the invocation with SoapSpy, perform the following:
Run server_java60/bin/soapspy.bat or soapspy.sh. This will bring up the SoapSpy GUI.
Start spying by selecting Start Spying from the Spy menu or by clicking the spy icon in the main pane.
Run the client using the run spy_client command instead of run_client.
To run using Persistent Deployment:
Be sure that you've started SESJ.
Compile OverloadService.
Windows: run.bat make_service Linux: ./run.sh make_service
Deploy OverloadService on the SESJ.
Windows: run.bat deploy_service Linux: ./run.sh deploy_service
Make the client classes.
Windows: ./run.bat make_client Linux: ./run.sh make_client
Run OverloadClient (it calls OverloadService).
Windows: ./run.bat run_client Linux: ./run.sh run_client
Undeploy OverloadService from the SESJ.
Windows: run.bat undeploy_service Linux: ./run.sh undeploy_service