ReadMe.txt
Purpose: - To introduce step-by-step configuration of "Sandesha" implementation.
Introduction:
There are three parts to Sandesha. All these three parts have to be configured properly for Sandesha to work.
1. Server part: This is the service side. Any Web service that wants to participate in RM has to be deployed in Axis with provider org.apache.sandesha.ws.rm.providers.RMProvider as its handler and these handlers in it's request flow: org.apache.sandesha.ws.rm.handlers.RMServerRequestHandler and org.apache.axis.message.addressing.handler.AddressingHandler. The following shows deployment descriptor for the sample PingService service:
{{{ <deployment xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<service name="PingService" provider="Handler">
<requestFlow> }}}
<handler type="java:org.apache.sandesha.ws.rm.handlers.RMServerRequestHandler"></handler>
{{{ <handler type="java:org.apache.axis.message.addressing.handler.AddressingHandler"></handler>
</requestFlow> <parameter name="handlerClass" value="org.apache.sandesha.ws.rm.providers.RMProvider"/> <parameter name="className" value="org.apache.sandesha.samples.interop.PingService"/> <parameter name="allowedMethods" value="*"/> <parameter name="scope" value="request"/>
</service> </deployment> }}}
Once the service is deployed like this, it is ready to participate in RM.
2. Client part: The client part involves two services: RMClientService and RMClientReference. For example, the deployment descriptor for these services are:
{{{ <deployment xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<service name="RMClientService" provider="java:RPC">
<parameter name="className" value="org.apache.sandesha.client.RMClientService"/> <parameter name="allowedMethods" value="*"/> <parameter name="scope" value="request"/>
</service>
<service name="RMClientReference" provider="Handler">
<requestFlow> }}}
<handler type="java:org.apache.sandesha.ws.rm.handlers.RMServerRequestHandler"></handler>
{{{ <handler type="java:org.apache.axis.message.addressing.handler.AddressingHandler"></handler>
</requestFlow>
<parameter name="handlerClass" value="org.apache.sandesha.ws.rm.providers.RMProvider"/> <parameter name="className" value="org.apache.sandesha.client.RMClientReference"/> <parameter name="allowedMethods" value="*"/> <parameter name="scope" value="request"/> </service>
</deployment> }}}
Note that these client side itself are services and have to be deployed in a seperate Axis instance in a seperate container.
3. Client: This is the client program which wants to participate in RM. For an Axis client to participate in RM, these client handlers have to be deployed - org.apache.sandesha.ws.rm.handlers.RMClientRequestHandler in request flow and org.apache.sandesha.ws.rm.handlers.RMClientResponseHandler in response flow. Here's is the sample:
{{{ <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:7080"/> <parameter name="action" value="wsrm:Ping"/> <parameter name="synchronized" value="false"/> <parameter name="replyTo" value="http://127.0.0.1:7080"/>
</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> </deployment> }}}
Here's the exaplaination for the parameters for org.apache.sandesha.ws.rm.handlers.RMClientRequestHandler:
{{{ sourceURI: This is the value of hostname or ip adress and port where the client services are running (RMClientService and RMClientReference, see 2 above)
- action: specify action for for the request synchronized: specify whenther the client wants a synchronize or asynchronize message exchange Reply To: has to specify the IP address and port of the Client machine that is going to receive the reply from the server (this could be same as sourceURI)
- }}}
Once the handlers are deployed on the client (example: java org.apache.axis.utils.Admin ClientDeploy.wsdd), you will have client-config.wsdd that will be used when the client invokes the service.
How the whole set up works:
1) The client program invokes the Web service at the service's endpoint URL. 2) Client handlers get invoked and re-direct the request (see 3 above) to client services (see 2 above) 3) The client side (see 2 above) takes over and then communicates with the Web service (see 1 above) 4) Client side and service side paricipate in RM 5) After the clien side receives the response, it is given back to the client program.
Pre-Conditions
1. Both client side and server side have to configure Tomcat and axis successfully 2. Client Application has to configure in different JVM. 3. Tomcat at the Client side has to start form different folder than Client folder.
Note 1: - This file has 2 sections; section 1 will introduce how to configure the
- "Sandesha" in a general situation. The section 2 will introduce how to configure the interop samples.
- Note 2: - Every section has two-configuration Client side and Server side
======================================================================================= Section 1
Sandesha Configuration
1.1 Server Configuration
Step 1. Copy all Sandesha classes to Tomat axis folder.
- Copy all org,apache.sandesha.* classes to TomcatHome/webapps/axis/WEB-INF/classes. Note: - Now Sandesha ready at server side.
Step 2. Deploy services with RMProvider, RMServerRequestHandler and AddressingHandler.
- If a service need to support for WS-RM, then the service has deploy with RMProvider,
RMServerRequestHandler and AddressingHandler. Note: - the sample wsdd file for deployment is available in
interop->org->apache->sandesha->sample->interop folder or sees below.
1.2 Client Configuration
Step 1. Copy all Sandesha classes to Tomat axis folder.
- Copy all org,apache.sandesha.* classes to TomcatHome/webapps/axis/WEB-INF/classes.
Step 2. Deploy RMClientService and RMClientReference.
Deploy RMClientService. (no special configuration needed )
ii. Deploy RMClientReference with RMServerRequestHandler, AddressingHandler and
- RMProvider.
org->apache->sandesha->client.
Stap 3:- Deploy the client application with RMClientRequestHandler and RMClientResponseHandler.
Note 1: - For RMClientRequestHandler need to set appropriate values for the following
- parameter in the WSDD file 1.Source URI: has to specify the IP address of the Client machine and port of the Client side Tomcat. 2.Reply To: has to specify the IP address of the Client machine that is going to receive the reply from the server and port of the receiver machine Tomcat. 3.Synchronized has to specify, whether the client expect a synchronize message exchange or asynchronies message exchange. 4.Action: has to specify the action of the request.
interop->org->apache->sandesha->sample->interop folder or sees below.
========================================================================================
Section 2.
Interop Sample Configuration
Pre-Conditions: -
1.The above steps for Sandesha configuration has to be finished up to Sandesha Ready stage {{{ at both client and server side.
- }}}
2.1 Server Side Configurations
Step 1:- Copy org.apache.sandesha.sample.interop.PingService.class and {{{ org.apache.sandesha.sample.interop.EchoStringService.class to
TomcatHome->webapps->axis->WEB-INF->classes }}}
Step 2:- Deploy the service with RMProvider, RMServerRequestHandler and AddressingHandler.
Note :- Sample WSDD is placed at interop->org->apache->sandesha->samples->interop
2.2 Client Side Configuration
- In this section we present the steps based on scenarios that has mention in the WS-Reliable Messaging: Interop Workshop Scenarios Document.
Pre-Condition
- Set the parameter in the Client Deploy WSDD as follows.
- Set the source URI and Reply To for your Client machine IP address and Tomcat
- port.
- Set Action as follows
For Ping Service wsrm:Ping ii. For Echo String Service wsrm:EchoString Note: - To deploy the client the following java run time command will be useful.
java org.apache.axis.utils.Admin ClientDeploy.wsdd
Scenario 1.1
In this Scenario we have two options: 1.Asynchronous 2.Synchronous 1.Asynchronous
Step 1: Set the synchronous as false for ping service in the Client Deploy WSDD and deploy the Client
Step 2: Run the Scenario_1_1_Client.
2.Synchronous
Step 1: Set the synchronous as true for ping service in the Client Deploy WSDD and deploy the Client
Step 2: Run the Scenario_1_1_Client.
Scenario 1.2
Physically disconnect the Client and Server and do the step in Scenario 1.1 and while running connect the both.
Scenario 2.1
Follow the step in Scenario 1.1, but in step 2 of the every section run the Scenario_1_2_Client.
- Note :- From this point on word we are going to support for Asynchronous mode only
- for all Set the synchronous as false for ping service and Echo Service in the Client Deploy WSDD and deploy the Client
Scenario 2.2, Scenario 2.3
Run the Scenario_2_2_Client and Scenario_2_3_Client with above configuration.