How to configure Sandesha
Sandesha configuration require few steps. Please check whether you have completed the following check list.
- Configure Axis in your machine. Assume that you have c:\tomcat in your machine.
- Then you have to copy the axis in to the tomcat.
- Download the lib folder from the Sandesha CVS and copy the jar files to c:\tomcat\webapps\axis\WEB-INF\libs
- Check whether the axis is working properly using happy axis service. Just check
- http//localhost:8080/axis/happyaxis.jsp
- Compile the Sandesha code. Here you have to compile all
- org.apache.sandesha.* classes including org.apache.sandesha.samples.interop.*
- Then copy all the classes to the c:\tomcat\webapps\axis\WEB-INF\classes
- Copy the classes to a directory where you want to test the scenarios as
well. Assume c:\SandeshaTest
Then copy the wsdd files that are there in the following three locations to the c:\SandeshaTest folder.
org.apache.sandesha.client. ClientEndpointManagerDeploy.wsdd b. org.apache.sandesha.samples.interop.ApplicationServiceDeploy.wsdd c. org.apache.sandesha.samples.interop. ClientDeploy.wsdd
Edit the ClientDeploy.wsdd files and the correct machine IP
- address where necessary
e.g. If your tomcat is running in the port 8080 the ClientDeploy.wsdd will be as follows.
- address where necessary
<!-- Use this file to deploy some handlers/chains and services -->
<!-- on the client. To do this simply run: -->
<!-- java org.apache.axis.utils.Admin ClientDeploy.wsdd -->
<!-- from the same dir that the Axis client will run in -->
<!-- This file will be replaced by WSDD once it's ready -->
<!-- for the parameters sourceURI and replyTo set suitable value as
set -->
<deployment name="test" xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<handler name="PingRequestHandler"
type="java:org.apache.sandesha.ws.rm.handlers.RMClientRequestHandler">
<parameter name="sourceURI" value="http://127.0.0.1:8080"/>
<parameter name="action" value="wsrm:Ping"/>
<parameter name="synchronized" value="false"/>
<parameter name="replyTo" value="http://127.0.0.1:8080"/>
</handler>
<handler name="EchoStringRequestHandler"
type="java:org.apache.sandesha.ws.rm.handlers.RMClientRequestHandler">
<parameter name="sourceURI" value="http://127.0.0.1:8080"/>
<parameter name="action" value="wsrm:echoString"/>
<parameter name="synchronized" value="false"/>
<parameter name="replyTo" value="http://127.0.0.1:8080"/>
</handler>
<handler name="RMClientResponseHandler"
type="java:org.apache.sandesha.ws.rm.handlers.RMClientResponseHandler">
</handler>
<service name="PingService" provider="java:RPC">
<requestFlow>
<handler type="PingRequestHandler"/> </requestFlow>
<responseFlow>
<handler type="RMClientResponseHandler"/>
</responseFlow>
<parameter name="className" value="org.apache.sandesha.samples.interop.PingService"/>
<parameter name="allowedMethods" value="*"/>
</service>
<service name="EchoStringService" provider="java:RPC"> <requestFlow>
<handler type="EchoStringRequestHandler"/> </requestFlow>
<responseFlow>
<handler type="RMClientResponseHandler"/>
</responseFlow>
<parameter name="className" value="org.apache.sandesha.samples.interop.EchoStringService"/>
<parameter name="allowedMethods" value="*"/>
</service>
</deployment>- Create the following bat files in the same working directory deploy.bat
@echo off set CATALINA_HOME=C:\OpenSource\Tomcat set AXIS_HOME=%CATALINA_HOME%\webapps\AXIS\WEB-INF set CLASSPATH=%AXIS_HOME%\lib\axis.jar set CLASSPATH=%CLASSPATH%;%AXIS_HOME%\lib\jaxrpc.jar set CLASSPATH=%CLASSPATH%;%AXIS_HOME%\lib\commons-discovery.jar set CLASSPATH=%CLASSPATH%;%AXIS_HOME%\lib\commons-logging.jar set CLASSPATH=%CLASSPATH%;%AXIS_HOME%\lib\saaj.jar set CLASSPATH=%CLASSPATH%;%AXIS_HOME%\lib\wsdl4j.jar set CLASSPATH=%CLASSPATH%;%AXIS_HOME%\lib\dom.jar set CLASSPATH=%CLASSPATH%;%CATALINA_HOME%\common\lib\xerces.jar set CLASSPATH=%CLASSPATH%;%AXIS_HOME% set CLASSPATH=%CLASSPATH%;. java org.apache.axis.client.AdminClient ApplicationServiceDeploy.wsdd java org.apache.axis.client.AdminClient ClientEndpointManagerDeploy.wsdd
- clientdeploy.bat
@echo off set CATALINA_HOME=C:\OpenSource\Tomcat set AXIS_HOME=%CATALINA_HOME%\webapps\AXIS\WEB-INF set CLASSPATH=%AXIS_HOME%\lib\axis.jar set CLASSPATH=%CLASSPATH%;%AXIS_HOME%\lib\jaxrpc.jar set CLASSPATH=%CLASSPATH%;%AXIS_HOME%\lib\commons-discovery.jar set CLASSPATH=%CLASSPATH%;%AXIS_HOME%\lib\commons-logging.jar set CLASSPATH=%CLASSPATH%;%AXIS_HOME%\lib\saaj.jar set CLASSPATH=%CLASSPATH%;%AXIS_HOME%\lib\wsdl4j.jar set CLASSPATH=%CLASSPATH%;%AXIS_HOME%\lib\dom.jar set CLASSPATH=%CLASSPATH%;%CATALINA_HOME%\common\lib\xerces.jar set CLASSPATH=%CLASSPATH%;. java org.apache.axis.utils.Admin client ClientDeploy.wsdd
test.bat
@echo off set CATALINA_HOME=C:\OpenSource\Tomcat set AXIS_HOME=%CATALINA_HOME%\webapps\AXIS\WEB-INF set CLASSPATH=%AXIS_HOME%\lib\axis.jar set CLASSPATH=%CLASSPATH%;%AXIS_HOME%\lib\jaxrpc.jar set CLASSPATH=%CLASSPATH%;%AXIS_HOME%\lib\commons-discovery.jar set CLASSPATH=%CLASSPATH%;%AXIS_HOME%\lib\commons-logging.jar set CLASSPATH=%CLASSPATH%;%AXIS_HOME%\lib\saaj.jar set CLASSPATH=%CLASSPATH%;%AXIS_HOME%\lib\wsdl4j.jar set CLASSPATH=%CLASSPATH%;%AXIS_HOME%\lib\dom.jar set CLASSPATH=%CLASSPATH%;%CATALINA_HOME%\common\lib\xerces.jar set CLASSPATH=%CLASSPATH%;%AXIS_HOME% set CLASSPATH=%CLASSPATH%;. java org.apache.sandesha.samples.interop.Scenario_1_1_Client http://127.0.0.1:8080/axis/services/PingService
10. Run the bat files. You only need to run the first two bat files
- only for once.
11. Change the class name of the Scenario in the test.bat for different scenarios accordingly.
- We will be creating a complete documentation for Sandesha soon.