- Back to the Main Page
- Check out how simple the SimpleEchoWSFacade.java Facade Class really is...
- Take a look at how easy it is to invoke the remote web service methods using the Generated Client Stubs, used by the test class TestSimpleWSEcho.java
- If you are interested in what the Client Stub Generator's generated code looks like, take a look at SimpleEchoWSFacadeWSClient.java
- Make sure the Sambuca JAR is in your classpath ([SAMBUCA_INSTALL_DIR]/bin/sambuca.jar). From the command line you can run [SAMBUCA_INSTALL_DIR]/cmd/setenv.bat from Windows to automatically set your classpath for the current command line session only.
- Run the com.roguelogic.sambuca.websrvcs.simple.WebServiceAutoMounter class. You can run [SAMBUCA_INSTALL_DIR]/cmd/SimpleEchoWebService.bat from Windows to start the WebServiceAutoMounter using the default command line arguments: com.roguelogic.sambuca.websrvcs.simple.SimpleEchoWSFacade 8181. This batch file will not set the optional system properties. See Usage below for more information.
- Usage of the Web Service Auto Mounter:
java <-DSambucaLogger=[CLASS_NAME]> com.roguelogic.sambuca.websrvcs.simple.WebServiceAutoMounter [WEB_SERVICE_FACADE_CLASS_NAME] [PORT]
Where [WEB_SERVICE_FACADE_CLASS_NAME] is the fully qualified class name of a java Facade, that the WebServiceAutoMounter will scan and make available ALL public methods of this class as Web Services via the supplied [PORT].
- Example: $JAVA_HOME/bin/java -cp /home/user/sambuca/bin/sambuca.jar com.roguelogic.sambuca.websrvcs.simple.WebServiceAutoMounter com.roguelogic.sambuca.websrvcs.simple.SimpleEchoWSFacade 8181
- To browse the Web Service Inventory XML descriptor, from a browser if you started your server on port 8181 enter the URL: http://localhost:8181/?action=GET-WS-INVENTORY.
- Make sure the WebServiceAutoMounter server is running on your local machine.
- Make sure the Sambuca JAR is in your classpath ([SAMBUCA_INSTALL_DIR]/bin/sambuca.jar). From the command line you can run [SAMBUCA_INSTALL_DIR]/cmd/setenv.bat from Windows to automatically set your classpath for the current command line session only.
- Run the com.roguelogic.sambuca.websrvcs.simple.ClientStubGenerator class. You can run [SAMBUCA_INSTALL_DIR]/cmd/GenerateSimpleEchoWSClient.bat from Windows to start the ClientStubGenerator using the default command line arguments: http://localhost:8181/?action=GET-WS-INVENTORY com.roguelogic.tests ../tests.
- Compile the generated class: SimpleEchoWSFacadeWSClient.java using javac or your favorite IDE (Make sure sambuca.jar is in your classpath when compiling!). You can also use the CompileTestSimpleEchoWS.bat to compile from the Sambuca Install directory.
- Make sure the WebServiceAutoMounter server is running on your local machine.
- Make sure the Sambuca JAR is in your classpath ([SAMBUCA_INSTALL_DIR]/bin/sambuca.jar). From the command line you can run [SAMBUCA_INSTALL_DIR]/cmd/setenv.bat from Windows to automatically set your classpath for the current command line session only.
- Make sure you generated and compiled the client stubs for SimpleEchoWSFacade using the instructions above.
- Compile the included test client class in the [SAMBUCA_INSTALL_DIR]/tests directory. The java file is: TestSimpleWSEcho.java in package com.roguelogic.tests. Make sure sambuca.jar is in your classpath as well as the client stub "SimpleEchoWSFacadeWSClient" you already generated and compiled.
- Run the com.roguelogic.tests.TestSimpleWSEcho passing the url to the WebServiceAutoMounter running with SimpleEchoWSFacade. Example: java com.roguelogic.tests.TestSimpleWSEcho http://localhost:8181/ (Or you can run the [SAMBUCA_INSTALL_DIR]\cmd\TestSimpleEchoWS.bat file on windows.)