You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fx-dev@ws.apache.org by ja...@apache.org on 2005/07/12 11:46:27 UTC
cvs commit: ws-sandesha/xdocs/images Architecture2.jpg ServerClass.jpg ServerReqWithAsyncAck.png ServerReqWithSyncAck.png ServerWithResponse.png ServerWithResponseSyncAck.png
jaliya 2005/07/12 02:46:27
Modified: config sandesha.properties
interop/org/apache/sandesha/interop IBMSyncPing.java
MicrosoftSyncPing.java SystinetSyncPing.java
samples/org/apache/sandesha/samples SyncPingClient.java
src/org/apache/sandesha Constants.java EnvelopeCreator.java
src/org/apache/sandesha/client ClientStorageManager.java
src/org/apache/sandesha/server InvokerFactory.java
ServerStorageManager.java
src/org/apache/sandesha/storage/queue SandeshaQueue.java
test/org/apache/sandesha/intergratedtest TCScenarioTest.java
xdocs architecture.html userguide.html
xdocs/images Architecture2.jpg ServerClass.jpg
ServerReqWithAsyncAck.png ServerReqWithSyncAck.png
ServerWithResponse.png
ServerWithResponseSyncAck.png
Log:
Changed the xdocs to reflect the current changes and formatted the code
Revision Changes Path
1.7 +0 -5 ws-sandesha/config/sandesha.properties
Index: sandesha.properties
===================================================================
RCS file: /home/cvs/ws-sandesha/config/sandesha.properties,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- sandesha.properties 7 Jul 2005 13:03:59 -0000 1.6
+++ sandesha.properties 12 Jul 2005 09:46:26 -0000 1.7
@@ -18,11 +18,6 @@
listenerRequestHandler1 = org.apache.axis.message.addressing.handler.AddressingHandler
listenerRequestHandler2 = org.apache.sandesha.ws.rm.handlers.RMServerRequestHandler
-# This is the configuration for the ACTUAL provider. Sandesha uses RMProvider as the provider and
-# axis engine uses RMProvider as the provider. We need to know the ACTUAL provider which does the
-# Service invocation. So the RMProvider will use RPCProvider to invoke services.
-providerClass = org.apache.axis.providers.java.RPCProvider
-
# Define the strategy for executing web service invokes.
# This impl uses the apache axis thread pool and configures
# it to the given size.
1.4 +1 -1 ws-sandesha/interop/org/apache/sandesha/interop/IBMSyncPing.java
Index: IBMSyncPing.java
===================================================================
RCS file: /home/cvs/ws-sandesha/interop/org/apache/sandesha/interop/IBMSyncPing.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- IBMSyncPing.java 11 Jul 2005 13:56:11 -0000 1.3
+++ IBMSyncPing.java 12 Jul 2005 09:46:27 -0000 1.4
@@ -43,7 +43,7 @@
Service service = new Service();
Call call = (Call) service.createCall();
- SandeshaContext ctx = new SandeshaContext(Constants.SYNCHRONIZED);
+ SandeshaContext ctx = new SandeshaContext(Constants.SYNCHRONOUS);
ctx.setToURL("http://wsi.alphaworks.ibm.com:8080/wsrm/services/rmDemos");
ctx.setAcksToURL(Constants.WSA.NS_ADDRESSING_ANONYMOUS);
1.7 +1 -1 ws-sandesha/interop/org/apache/sandesha/interop/MicrosoftSyncPing.java
Index: MicrosoftSyncPing.java
===================================================================
RCS file: /home/cvs/ws-sandesha/interop/org/apache/sandesha/interop/MicrosoftSyncPing.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- MicrosoftSyncPing.java 11 Jul 2005 13:56:11 -0000 1.6
+++ MicrosoftSyncPing.java 12 Jul 2005 09:46:27 -0000 1.7
@@ -38,7 +38,7 @@
Service service = new Service();
Call call = (Call) service.createCall();
- SandeshaContext ctx = new SandeshaContext(Constants.SYNCHRONIZED);
+ SandeshaContext ctx = new SandeshaContext(Constants.SYNCHRONOUS);
ctx.setToURL("http://131.107.153.195/SecureReliableMessaging/ReliableOneWay.svc");
//We really do not want to send wsa:ReplyTo header for a synchronous operation.
1.4 +1 -1 ws-sandesha/interop/org/apache/sandesha/interop/SystinetSyncPing.java
Index: SystinetSyncPing.java
===================================================================
RCS file: /home/cvs/ws-sandesha/interop/org/apache/sandesha/interop/SystinetSyncPing.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- SystinetSyncPing.java 11 Jul 2005 13:56:11 -0000 1.3
+++ SystinetSyncPing.java 12 Jul 2005 09:46:27 -0000 1.4
@@ -42,7 +42,7 @@
Service service = new Service();
Call call = (Call) service.createCall();
- SandeshaContext ctx = new SandeshaContext(Constants.SYNCHRONIZED);
+ SandeshaContext ctx = new SandeshaContext(Constants.SYNCHRONOUS);
ctx.setToURL("http://soap.systinet.net:6064/Service");
ctx.initCall(call, targetURL, "urn:wsrm:Ping", Constants.ClientProperties.IN_ONLY);
1.5 +1 -1 ws-sandesha/samples/org/apache/sandesha/samples/SyncPingClient.java
Index: SyncPingClient.java
===================================================================
RCS file: /home/cvs/ws-sandesha/samples/org/apache/sandesha/samples/SyncPingClient.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- SyncPingClient.java 11 Jul 2005 13:56:12 -0000 1.4
+++ SyncPingClient.java 12 Jul 2005 09:46:27 -0000 1.5
@@ -48,7 +48,7 @@
Service service = new Service();
Call call = (Call) service.createCall();
- SandeshaContext ctx = new SandeshaContext(Constants.SYNCHRONIZED);
+ SandeshaContext ctx = new SandeshaContext(Constants.SYNCHRONOUS);
ctx.initCall(call, targetURL, "urn:wsrm:Ping",
Constants.ClientProperties.IN_ONLY);
1.60 +1 -1 ws-sandesha/src/org/apache/sandesha/Constants.java
Index: Constants.java
===================================================================
RCS file: /home/cvs/ws-sandesha/src/org/apache/sandesha/Constants.java,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -r1.59 -r1.60
--- Constants.java 11 Jul 2005 13:56:12 -0000 1.59
+++ Constants.java 12 Jul 2005 09:46:27 -0000 1.60
@@ -70,7 +70,7 @@
byte SERVER = (byte) 1;
byte CLIENT = (byte) 0;
- int SYNCHRONIZED = 0;
+ int SYNCHRONOUS = 0;
public interface WSA {
String NS_ADDRESSING_ANONYMOUS = AddressingUtils.getAnonymousRoleURI();
1.49 +1 -1 ws-sandesha/src/org/apache/sandesha/EnvelopeCreator.java
Index: EnvelopeCreator.java
===================================================================
RCS file: /home/cvs/ws-sandesha/src/org/apache/sandesha/EnvelopeCreator.java,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- EnvelopeCreator.java 11 Jul 2005 13:56:12 -0000 1.48
+++ EnvelopeCreator.java 12 Jul 2005 09:46:27 -0000 1.49
@@ -200,7 +200,7 @@
outGoingAddressingHaders.setFrom(from);
if (addressingHeaders.getReplyTo() == null)
- throw new Exception("ReplyTo is required to send Responses");
+ throw new Exception("wsa:ReplyTo is required to send Responses");
AttributedURI inReplyTo = addressingHeaders.getReplyTo().getAddress();
To to = new To(new URI(inReplyTo.toString()));
outGoingAddressingHaders.setTo(to);
1.50 +8 -27 ws-sandesha/src/org/apache/sandesha/client/ClientStorageManager.java
Index: ClientStorageManager.java
===================================================================
RCS file: /home/cvs/ws-sandesha/src/org/apache/sandesha/client/ClientStorageManager.java,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -r1.49 -r1.50
--- ClientStorageManager.java 11 Jul 2005 13:56:12 -0000 1.49
+++ ClientStorageManager.java 12 Jul 2005 09:46:27 -0000 1.50
@@ -33,6 +33,13 @@
import java.util.Map;
import java.util.Set;
+/**
+ * This is the storage manager for Client side in Sandesha
+ * Provides the access points for the SandeshaQueue.
+ *
+ * @author Chamikara Jayalath
+ * @author Jaliya Ekanayake
+ */
public class ClientStorageManager implements IStorageManager {
protected static Log log = LogFactory.getLog(ClientStorageManager.class.getName());
@@ -212,24 +219,11 @@
return msgNo;
}
- /*
- * (non-Javadoc)
- *
- * @see org.apache.sandesha.IStorageManager#insertOutgoingMessage
- * (org.apache.sandesha.RMMessageContext)
- */
public void insertOutgoingMessage(RMMessageContext msg) {
String sequenceId = msg.getSequenceID();
accessor.addMessageToOutgoingSequence(sequenceId, msg);
}
- /*
- * (non-Javadoc)
- *
- * @see org.apache.sandesha.IStorageManager#insertIncomingMessage
- *(org.apache.sandesha.RMMessageContext)
- */
-
public void insertIncomingMessage(RMMessageContext rmMessageContext) {
RMHeaders rmHeaders = rmMessageContext.getRMHeaders();
RelatesTo relatesTo = (RelatesTo) rmMessageContext.getAddressingHeaders().getRelatesTo()
@@ -253,28 +247,16 @@
accessor.updateFinalMessageArrivedTime(sequenceId);
}
-
public RMMessageContext checkForResponseMessage(String sequenceId, String requestMsgId) {
RMMessageContext response = accessor.checkForResponseMessage(requestMsgId, sequenceId);
return response;
}
-
- public void insertTerminateSeqMessage(RMMessageContext terminateSeqMessage) {
+ public void insertTerminateSeqMessage(RMMessageContext terminateSeqMessage) {
accessor.addLowPriorityMessage(terminateSeqMessage);
}
-
-// --Commented out by Inspection START (7/7/05 2:15 PM):
-// public boolean isAllSequenceComplete() {
-// boolean outTerminateSent = accessor.isAllOutgoingTerminateSent();
-// boolean incomingTerminateReceived = accessor.isAllIncommingTerminateReceived();
-// return outTerminateSent && incomingTerminateReceived;
-// }
-// --Commented out by Inspection STOP (7/7/05 2:15 PM)
-
-
public void setAckReceived(String seqId, long msgNo) {
accessor.setAckReceived(seqId, msgNo);
}
@@ -283,7 +265,6 @@
}
-
public void addSendMsgNo(String seqId, long msgNo) {
accessor.addSendMsgNo(accessor.getSequenceOfOutSequence(seqId), msgNo);
}
1.3 +0 -12 ws-sandesha/src/org/apache/sandesha/server/InvokerFactory.java
Index: InvokerFactory.java
===================================================================
RCS file: /home/cvs/ws-sandesha/src/org/apache/sandesha/server/InvokerFactory.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- InvokerFactory.java 11 Jul 2005 13:56:12 -0000 1.2
+++ InvokerFactory.java 12 Jul 2005 09:46:27 -0000 1.3
@@ -44,35 +44,23 @@
return INSTANCE;
}
-
/**
* Create the <code>RMInvokerStrategy</code> impl.
*/
public InvokeStrategy createInvokerStrategy() throws Exception {
-
String strategyClassName = PropertyLoader.getInvokeStrategyClassName();
-
InvokeStrategy strategy = (InvokeStrategy) Class.forName(strategyClassName).newInstance();
-
strategy.addParams(PropertyLoader.getInvokeStrategyParams());
-
return strategy;
-
}
public InvokeHandler createInvokeHandler() throws Exception {
-
String handlerClassName = PropertyLoader.getInvokeHandlerClassName();
-
InvokeHandler handler = (InvokeHandler) Class.forName(handlerClassName).newInstance();
-
handler.addParams(PropertyLoader.getInvokeHandlerParams());
-
return handler;
-
}
-
}
1.41 +0 -1 ws-sandesha/src/org/apache/sandesha/server/ServerStorageManager.java
Index: ServerStorageManager.java
===================================================================
RCS file: /home/cvs/ws-sandesha/src/org/apache/sandesha/server/ServerStorageManager.java,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- ServerStorageManager.java 11 Jul 2005 13:56:12 -0000 1.40
+++ ServerStorageManager.java 12 Jul 2005 09:46:27 -0000 1.41
@@ -180,7 +180,6 @@
String sequenceID = rmMessageContext.getSequenceID();
if (sequenceID != null)
accessor.removeAllAcks(sequenceID);
-
addPriorityMessage(rmMessageContext);
}
1.31 +19 -10 ws-sandesha/src/org/apache/sandesha/storage/queue/SandeshaQueue.java
Index: SandeshaQueue.java
===================================================================
RCS file: /home/cvs/ws-sandesha/src/org/apache/sandesha/storage/queue/SandeshaQueue.java,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- SandeshaQueue.java 11 Jul 2005 13:56:13 -0000 1.30
+++ SandeshaQueue.java 12 Jul 2005 09:46:27 -0000 1.31
@@ -418,19 +418,21 @@
}
public String getSequenceOfOutSequence(String outSequence) {
- if (outSequence == null) {
- return null;
- }
synchronized (outgoingMap) {
+ if (outSequence == null) {
+ return null;
+ }
+ String tempSeqId = null;
Iterator it = outgoingMap.keySet().iterator();
while (it.hasNext()) {
- String tempSeqId = (String) it.next();
+ tempSeqId = (String) it.next();
OutgoingSequence rsh = (OutgoingSequence) outgoingMap.get(tempSeqId);
String tempOutSequence = rsh.getOutSequenceId();
- if (outSequence.equals(tempOutSequence))
- return tempSeqId;
+ if (outSequence.equals(tempOutSequence)) {
+ break;
+ }
}
- return null;
+ return tempSeqId;
}
}
@@ -890,11 +892,18 @@
synchronized (highPriorityQueue) {
int size = highPriorityQueue.size();
+ ArrayList remLst = new ArrayList();
+
for (int i = 0; i < size; i++) {
RMMessageContext msg = (RMMessageContext) highPriorityQueue.get(i);
- if (msg.getSequenceID().equals(sequenceID) &&
- msg.getMessageType() == Constants.MSG_TYPE_ACKNOWLEDGEMENT)
- highPriorityQueue.remove(i);
+ if (msg.getSequenceID() != null)
+ if (msg.getSequenceID().equals(sequenceID) && msg.getMessageType() == Constants.MSG_TYPE_ACKNOWLEDGEMENT)
+ remLst.add(new Integer(i));
+ }
+
+ for (int i = 0; i < remLst.size(); i++) {
+ Integer in = (Integer) remLst.get(i);
+ highPriorityQueue.remove(in.intValue());
}
}
}
1.10 +1 -1 ws-sandesha/test/org/apache/sandesha/intergratedtest/TCScenarioTest.java
Index: TCScenarioTest.java
===================================================================
RCS file: /home/cvs/ws-sandesha/test/org/apache/sandesha/intergratedtest/TCScenarioTest.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- TCScenarioTest.java 11 Jul 2005 13:56:13 -0000 1.9
+++ TCScenarioTest.java 12 Jul 2005 09:46:27 -0000 1.10
@@ -93,7 +93,7 @@
Service service = new Service();
Call call = (Call) service.createCall();
- SandeshaContext ctx = new SandeshaContext(Constants.SYNCHRONIZED);
+ SandeshaContext ctx = new SandeshaContext(Constants.SYNCHRONOUS);
ctx.initCall(call, targetURL, "urn:wsrm:Ping", Constants.ClientProperties.IN_ONLY);
call.setOperationName(new QName("http://tempuri.org/", "Ping"));
1.8 +13 -6 ws-sandesha/xdocs/architecture.html
Index: architecture.html
===================================================================
RCS file: /home/cvs/ws-sandesha/xdocs/architecture.html,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- architecture.html 11 Jun 2005 10:22:44 -0000 1.7
+++ architecture.html 12 Jul 2005 09:46:27 -0000 1.8
@@ -85,7 +85,7 @@
architecture will emerge when the Axis specific components are added to the
above diagram. A complete diagram would be as follows.</p>
<p align="center">
-<img border="0" src="images/Architecture2.jpg" width="637" height="219"></p>
+<img border="0" src="images/Architecture2.jpg"></p>
<p align="center">
<font size="2">Figure 3: Sandesha Architecture on top of Apache Axis</font></p>
<p >The
@@ -101,6 +101,10 @@
the apache Axis. Axis is essentially a SOAP engine
a framework for constructing SOAP processors such as clients, servers, gateways,
etc.</p>
+<h3 >SandeshaContext</h3>
+<p >This component keeps track of the different sequences created by the client
+and helps the client application to set various Sandesha specific properties to
+a particular Call object used by the client. </p>
<h3 >RMSender</h3>
<p >This is the transport
sender that the user should use in order to enable reliability in the client
@@ -136,14 +140,17 @@
and insert the required message or messages to the Queue. It will also generate
messages for Reliable Messaging specific messages such as <wsrm:AckRequested>,
see [3].</p>
-<h3 align="left"><fonts>RMInvoker</h3>
-<p align="left">This is a runnable component that actually handles the
-dispatching of the web service request to the actual service. RMInvoker will
-also put the service response (if any) to the Queue present in the server side.</p>
+<h3 align="left"><fonts>Invoker</h3>
+<p align="left">Invoker represents a set of components that does the web service
+invocation. According to the Axis architecture, the provider is the one which
+does the web service invocation. However, Sandesha architecture breaks the logic
+of the provider into two parts , first part putting the messages to the queue
+and the second part that is the Invoker which does the invocation. This provides
+the users to configure the Invoker component. More details on how to configure
+the Invoker is given in <a href="userguide.html">userguide</a>.</p>
<h3 align="left">Service</h3>
<p > This is the actual web service, which will be the Application Destination
according to the high-level architecture.</p>
-<p > </p>
<h2 >Class diagrams</h2>
<h3 >Sandesha Server</h3>
<p >Following diagram describes the class structure of the Sandesha server.</p>
1.11 +128 -102 ws-sandesha/xdocs/userguide.html
Index: userguide.html
===================================================================
RCS file: /home/cvs/ws-sandesha/xdocs/userguide.html,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- userguide.html 11 Jun 2005 10:22:44 -0000 1.10
+++ userguide.html 12 Jul 2005 09:46:27 -0000 1.11
@@ -18,14 +18,15 @@
<h2><font size="5">Configuration</font></h2>
<p>Sandesha can be downloaded as binary or source <a href="releases.html">distributions</a>. This document assumes that
the user has downloaded the binary distribution, however if you have downloaded
-the source distribution, you can create the binaries using the maven command
-"maven dist-bin".</p>
+the source distribution, you can create the binaries by simply running maven
+goal
+"dist-bin".</p>
<p>Following steps will guide to configure Apache Sandesha on both client and
server sides.</p>
<h2><font size="5">Use Sandesha in the Client Side</font></h2>
<p>Following two steps will enable the usage of Sandesha in the Client Side.</p>
<ul type="square">
- <li>Copy the <b>Sandesha-beta.jar</b> to your classpath (this jar can be found
+ <li>Copy the <b>Sandesha-1.0-RC1.jar</b> to your classpath (this jar can be found
in the root directory of the unzipped binary distribution)</li>
<li>Add the jars in the "lib" directory of the binary distribution to your
classpath.</li>
@@ -33,14 +34,14 @@
<p>There are two main ways that one can use axis to write web service client
applications.</p>
<ol>
- <li>1. Using Generated Stubs</li>
- <li>2. Using Dynamic Invocation Interface (DII)</li>
+ <li> Using Generated Stubs</li>
+ <li> Using Dynamic Invocation Interface (DII)</li>
</ol>
-<p>At the moment when we generate the stubs there is no way that we can inform
+<p>At the moment there is no way that we can inform
the apache tool (wsdl2java) to generate stubs that are Sandesha aware and hence
we need to use the DII in order to use Sandesha in the client side. However if
there are existing stubs, then to use Sandesha with them the user has to
-manually edit the stubs generated to insert properties to the call object.</p>
+manually edit the generated stubs to insert properties to the call object.</p>
<h3>Simple Request-Response Client</h3>
<p>To use Sandesha in the client side, user has to add few lines to the
existing client. Following code fragment shows the required additions that one
@@ -50,7 +51,7 @@
Service service = new Service();
Call call = (Call) service.createCall();
<span style="background-color: #CCCCCC">SandeshaContext ctx = new SandeshaContext();</span>
- <span style="background-color: #CCCCCC">ctx.addNewSequeceContext(call, targetUrl,</span>
+ <span style="background-color: #CCCCCC">ctx.initCall(call, targetUrl,</span>
<span style="background-color: #CCCCCC">"urn:wsrm:echoString",Constants.ClientProperties.IN_OUT);</span>
call.setOperationName(new QName("http://tempuri.org/", "echoString"));
call.addParameter("Text", XMLType.XSD_STRING, ParameterMode.IN);
@@ -61,19 +62,19 @@
String ret = (String) call.invoke(new Object[]{"Sandesha Echo 1", "abcdef"});
System.out.println("The Response for First Messsage is :" + ret);
- <span style="background-color: #CCCCCC">ctx.endSequence(call);</span>
+ <span style="background-color: #CCCCCC">ctx.endSequence();</span>
} catch (Exception e) { e.printStackTrace();
}
}</pre></source></p>
<h4>Explanation on Additions :</h4>
<p>
<span style="font-weight: 700; background-color: #CCCCCC">SandeshaContext ctx = new SandeshaContext();</span></p>
-<p>This is the initial step in initializing the RMSource (Client side ReliableMessaging
-Endpoint). SandeshaContext is used to keep track of different sequences that the
-client may create throughout the its lifecycle. Client can "add" any number of
-sequences and "end" them in any order.</p>
+<p>This is the initial step in initializing the RMSource (Client side
+ReliableMessaging Endpoint). SandeshaContext is used to keep track of different
+sequences that the client may create throughout the its lifecycle. Client can
+add any number of call objects to the context.</p>
<p>
-<span style="font-weight: 700; background-color: #CCCCCC">ctx.addNewSequeceContext(call,targetUrl ,
+<span style="font-weight: 700; background-color: #CCCCCC">ctx.initCall(call,targetUrl ,
"urn:wsrm:Ping", Constants.ClientProperties.IN_ONLY);</span></p>
<p>Using this step the client can add the call object to the SandeshaContext,
with targetUrl,<wsa:Action> and the Message Exchange Pattern (MEP) as the
@@ -89,7 +90,7 @@
a single message scenario as above, however this is a "REQUIRED" property for
RMSource and this will add the <wsrm:LastMessage> header to the outgoing message.</p>
<p>
-<span style="font-weight: 700; background-color: #CCCCCC">ctx.endSequence(call);</span></p>
+<span style="font-weight: 700; background-color: #CCCCCC">ctx.endSequence();</span></p>
<p>This is the last statement relating to this invocation sequence. RMSource will
wait till all the messages been acknowledged and the terminate sequence for this
particular sequence is sent, before returning the control back to the invocation
@@ -112,7 +113,7 @@
Call call = (Call) service.createCall();
SandeshaContext ctx = new SandeshaContext();
- ctx.addNewSequeceContext(call,targetUrl ,
+ ctx.initCall(call,targetUrl ,
"urn:wsrm:Ping", Constants.ClientProperties.IN_ONLY);
call.setOperationName(new QName("http://tempuri.org/", "ping"));
call.addParameter("arg1", XMLType.XSD_STRING, ParameterMode.IN);
@@ -121,7 +122,7 @@
call.invoke(new Object[]{"Sandesha Ping 2"});
ctx.setLastMessage(call);
call.invoke(new Object[]{"Sandesha Ping 3"});
- ctx.endSequence(call);
+ ctx.endSequence();
} catch (Exception e) {
e.printStackTrace();
@@ -141,9 +142,9 @@
Service service = new Service();
Call call = (Call) service.createCall();
- SandeshaContext ctx = new SandeshaContext();
+ <span style="background-color: #FFFF99">SandeshaContext ctx = new SandeshaContext(Constants.SYNCHRONOUS);</span>
<span style="background-color: #CCCCCC">ctx.addNewSequeceContext(call,targetUrl ,</span>
- <span style="background-color: #CCCCCC">"urn:wsrm:Ping", Constants.ClientProperties.IN_ONLY,</span><span style="background-color: #FFFF99">true</span>);
+ <span style="background-color: #CCCCCC">"urn:wsrm:Ping", Constants.ClientProperties.IN_ONLY</span>);
call.setOperationName(new QName("http://tempuri.org/", "ping"));
call.addParameter("arg1", XMLType.XSD_STRING, ParameterMode.IN);
@@ -162,9 +163,8 @@
<p>The only change we need is to set the flag "sync" to "true" when we add the
sequence to SandeshaContext, as shown bellow.</p>
-<p><b>
-<span style="background-color: #CCCCCC">ctx.addNewSequeceContext(call,targetUrl ,
- "urn:wsrm:Ping", Constants.ClientProperties.IN_ONLY,</span><span style="background-color: #FFFF99">true</span>);</b><p>By these, client can inform the RMSource, not to start a separate client side
+<h3><span style="background-color: #FFFF99">SandeshaContext ctx = new SandeshaContext(Constants.SYNCHRONOUS);</span></h3>
+<p>By these, client can inform the RMSource, not to start a separate client side
listener and send the requests with "<b>anonymous URI</b>" in <wsa:From> and <wsrm:AcksTo>
headers. So the server will use the same transport connection to send Create
Sequence Response and Acknowledgements.</p>
@@ -183,12 +183,12 @@
way) to get the correct functionality. Following code fragment contains all the
parameters that the client can set inside the client code.</p>
-<source><pre> ctx.setToUrl(call, "http://test.organization.com:8080/wsrm/services/rmDemos");
- ctx.setFromUrl(call, "http://our.organization.org:9070/axis/services/RMService");
- ctx.setReplyToUrl(call, "http://our.organization.org:9070/axis/services/RMService");
- ctx.setAcksToUrl(call, "http://our.organization.org:9070/axis/services/RMService");
- ctx.setFaultToUrl(call, "http://our.organization.org:9070/axis/services/RMService");
- ctx.setSendOffer(call);</pre></source></p>
+<source><pre>ctx.setToURL("http://test.organization.com:8080/wsrm/services/rmDemos");
+ctx.setFromURL("http://our.organization.org:9070/axis/services/RMService");
+ctx.setReplyToURL("http://our.organization.org:9070/axis/services/RMService");
+cyx.setAcksToURL("http://our.organization.org:9070/axis/services/RMService");
+ctx.setFaultToURL("http://our.organization.org:9070/axis/services/RMService");
+ctx.setSendOffer(true);</pre></source></p>
<p>These properties are very useful when debugging applications. By changing
them appropriately the user can route messages through TCP Monitor or some
@@ -209,65 +209,63 @@
operations are in the same service "RMInteropService" as two different
operations. However these need NOT be operations of a single service.</p>
-<p><source><pre>public void testEchoPing() throws Exception {
- System.out.println("===========Echo and Ping Combined Test Started=============");
- UUIDGen uuidGen = UUIDGenFactory.getUUIDGen(); //Can use this for continuous testing.
- String str = uuidGen.nextUUID();
-
- Service service = new Service();
- Call echoCall = (Call) service.createCall();
-
- SandeshaContext ctx = new SandeshaContext();
- //------------------------ECHO------------------------------------------
- ctx.addNewSequeceContext(echoCall, targetURL, "urn:wsrm:echoString",
- Constants.ClientProperties.IN_OUT);
- ctx.setAcksToUrl(echoCall,
- "http://127.0.0.1:" + defaultClientPort + "/axis/services/RMService");
- ctx.setReplyToUrl(echoCall,
- "http://127.0.0.1:" + defaultClientPort + "/axis/services/RMService");
- ctx.setSendOffer(echoCall);
-
- echoCall.setOperationName(new QName("http://tempuri.org/", "echoString"));
-
- echoCall.addParameter("arg1", XMLType.XSD_STRING, ParameterMode.IN);
- echoCall.addParameter("arg2", XMLType.XSD_STRING, ParameterMode.IN);
- echoCall.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);
- //----------------------ECHO----------------------------------------------
-
- //------------------------PING--------------------------------------------
- Call pingCall = (Call) service.createCall();
- ctx.addNewSequeceContext(pingCall, targetURL, "urn:wsrm:Ping",
- Constants.ClientProperties.IN_ONLY);
- ctx.setAcksToUrl(pingCall,
- "http://127.0.0.1:" + defaultClientPort + "/axis/services/RMService");
-
- pingCall.setOperationName(new QName("http://tempuri.org/", "ping"));
- pingCall.addParameter("arg2", XMLType.XSD_STRING, ParameterMode.IN);
- //----------------------PING----------------------------------------------
-
- String ret = (String) echoCall.invoke(new Object[]{"Sandesha Echo 1", str});
- System.out.println("The Response for First Messsage is :" + ret);
- pingCall.invoke(new Object[]{ret});
-
- ret = (String) echoCall.invoke(new Object[]{"Sandesha Echo 2", str});
- System.out.println("The Response for Second Messsage is :" + ret);
- pingCall.invoke(new Object[]{ret});
-
- ctx.setLastMessage(echoCall);
- ret = (String) echoCall.invoke(new Object[]{"Sandesha Echo 3", str});
- System.out.println("The Response for Third Messsage is :" + ret);
- ctx.setLastMessage(pingCall);
- pingCall.invoke(new Object[]{ret});
-
- RMReport echoReport = ctx.endSequence(echoCall);
- RMReport pingReport=ctx.endSequence(pingCall);
-
- assertEquals(echoReport.isAllAcked(), true);
- assertEquals(echoReport.getNumberOfReturnMessages(), 3);
-
- assertEquals(pingReport.isAllAcked(), true);
- assertEquals(pingReport.getNumberOfReturnMessages(), 0);
- System.out.println("===========Echo and Ping Combined Test Finished==========");
+<source><pre>public void testEchoPing() throws Exception {
+ System.out.println(" Echo and Ping Combined Test Started");
+ UUIDGen uuidGen = UUIDGenFactory.getUUIDGen(); //Can use this for continuous testing.
+ String str = uuidGen.nextUUID();
+
+ Service service = new Service();
+ Call echoCall = (Call) service.createCall();
+
+ SandeshaContext ctx = new SandeshaContext();
+ //------------------------ECHO--------------------------------------------
+
+ ctx.setAcksToURL("http://127.0.0.1:" + defaultClientPort + "/axis/services/RMService");
+ ctx.setReplyToURL("http://127.0.0.1:" + defaultClientPort + "/axis/services/RMService");
+ ctx.setSendOffer(true);
+ ctx.initCall(echoCall, targetURL, "urn:wsrm:echoString", Constants.ClientProperties.IN_OUT);
+
+ echoCall.setOperationName(new QName("http://tempuri.org/", "echoString"));
+ echoCall.addParameter("arg1", XMLType.XSD_STRING, ParameterMode.IN);
+ echoCall.addParameter("arg2", XMLType.XSD_STRING, ParameterMode.IN);
+ echoCall.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);
+ //----------------------ECHO------------------------------------------------
+
+ //------------------------PING--------------------------------------------
+ Service pingService = new Service();
+ Call pingCall = (Call) pingService.createCall();
+ SandeshaContext pingCtx = new SandeshaContext();
+ pingCtx.setAcksToURL("http://127.0.0.1:" + defaultClientPort + "/axis/services/RMService");
+ pingCtx.setReplyToURL("http://127.0.0.1:" + defaultClientPort + "/axis/services/RMService");
+
+ pingCtx.initCall(pingCall, targetURL, "urn:wsrm:Ping", Constants.ClientProperties.IN_ONLY);
+
+ pingCall.setOperationName(new QName("http://tempuri.org/", "ping"));
+ pingCall.addParameter("arg2", XMLType.XSD_STRING, ParameterMode.IN);
+ //----------------------PING------------------------------------------------
+
+ String ret = (String) echoCall.invoke(new Object[]{" Echo 1 ", str});
+ System.out.println(" The Response for First Messsage is :" + ret);
+ pingCall.invoke(new Object[]{ret});
+
+ ctx.setLastMessage(echoCall);
+ ret = (String) echoCall.invoke(new Object[]{" Echo 2 ", str});
+ System.out.println(" The Response for Second Messsage is :" + ret);
+ pingCall.invoke(new Object[]{ret});
+
+ pingCtx.setLastMessage(pingCall);
+ pingCall.invoke(new Object[]{ret});
+
+ RMReport echoReport = ctx.endSequence();
+ RMReport pingReport = pingCtx.endSequence();
+
+ assertEquals(echoReport.isAllAcked(), true);
+ assertEquals(echoReport.getNumberOfReturnMessages(), 2);
+
+ assertEquals(pingReport.isAllAcked(), true);
+ assertEquals(pingReport.getNumberOfReturnMessages(), 0);
+ testCount--;
+ System.out.println(" Echo and Ping Combined Test Finished");
}
</pre></source></p>
@@ -280,7 +278,7 @@
<p>Sandesha configuration in the server side can be explained using two simple
steps. (Assume that axis is configured in Tomcat Server)</p>
<ul type="square">
- <li>Copy the <b>Sandesha-beta.jar</b> to the <b>CATALINA_HOME/webapps/axis/WEB-INF/lib</b> along
+ <li>Copy the <b>Sandesha-1.0-RC1.jar</b> to the <b>CATALINA_HOME/webapps/axis/WEB-INF/lib</b> along
with the other new jars that can be found in <b>lib</b> directory of Sandesha.
(If you are using the Axis1.2 release, then the user have to copy only the
"addressing-SNAPTSHOT.jar" additionally)</li>
@@ -293,7 +291,7 @@
service. (make sure that the classes for the <b>MyService</b> is copied to <b>CATALINA_HOME/webapps/axis/WEB-INF/classes. RMProvider</b> by default will
use the <b>RPCProvider</b> to invoke the services, however user can specify the
actual provider that is required to invoke a particular service in <b>sandesha.properties</b> file that can be found in
-<b>Sandesha-beta.jar</b>.</p>
+<b>Sandesha-1.0-RC1.jar</b>.</p>
<source><pre><deployment xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
@@ -309,6 +307,39 @@
</service>
</deployment></pre></source></p>
+<h3>sandesha.properties</h3>
+<p>Following section shows the typical configuration for sandesha.properties.
+Please see the in each property for explanation on that property</p>
+<source><pre>
+# This is the port in which client side listener listens.
+CLIENT_LISTENER_PORT = 9090
+
+# This is the SimpleAxisServerImpl running port. Only for testing purposes.
+SIMPLE_AXIS_SERVER_PORT = 8080
+
+# Any number of handlers can be included as shown below for the response path of the Sender. These two are mandatory.
+responseHandler1 = org.apache.axis.message.addressing.handler.AddressingHandler
+responseHandler2 = org.apache.sandesha.ws.rm.handlers.RMServerRequestHandler
+
+# If there are additional handlers that needs to be included in the Senders request path
+# then use the following configuration.
+# requestHandler1 = package.name.DummyHandler
+
+# These are the handlers for the Listener's request path. Listener's request path is used to
+# retrieve asynchronous responses and other RM protocol messages and hence the handlers we put here
+# should be the RESPONSE handlers with respect to normal invocation. These two are mandatory.
+listenerRequestHandler1 = org.apache.axis.message.addressing.handler.AddressingHandler
+listenerRequestHandler2 = org.apache.sandesha.ws.rm.handlers.RMServerRequestHandler
+
+# Define the strategy for executing web service invokes.D
+# This impl uses the apache axis thread pool and configures
+# it to the given size.
+invokeStrategy=org.apache.sandesha.server.ThreadPoolInvokeStrategy:threadPoolSize=10
+
+# Define the invoke handler that will execute the web service invokes.
+# This impl simply delegates to the handler specified by the "invoker" param.
+invokeHandler=org.apache.sandesha.server.DelegateInvokeHandler:invoker=org.apache.axis.providers.java.RPCProvider
+</pre></source></p>
<h3>Using RMSource Inside a Server</h3>
<p>A common usage of this scenario would be the use of Sandesha from a web
@@ -363,20 +394,9 @@
<h2>Running Samples </h2>
-<p>If you are using the binary distribution of Sandesha then the samples are
-already built and inside the Sandesha-beta.jar itself. Therefore the testing is
-just matter of executing some ant targets provided in the "build.xml" file in
+<p>To test the samples automatically, execute the following ant targets provided in the "build.xml" file in
the samples directory. If you have downloaded the source distribution and need
to run the samples, please build the source first using the maven.</p>
-<p>If you need a project to be created for Eclipse or Intellij IDEA use the
-maven commands</p>
-<p>
-<source>maven eclipse</source> </p>
-<p><source>maven idea</source> </p>
-<h3><font size="4">Run the Samples</font></h3>
-<p>Go to the directory, samples under the main directory tree. To run the sample
-scenarios we only need to type simple ant commands in a command line.</p>
-<p>Followings are the commands to run the samples scenarios.</p>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
<tr>
<td width="13%">Ant command</td>
@@ -408,7 +428,13 @@
</table>
<p>In all these scenarios the service <b>RMSampleService</b> is deployed in a <b>SimpleAxisServer</b>
using the ant script and the results will be shown in TCP monitors. </p>
-<p> </p>
+<p>In addition Sandesha-samples.jar that contains all the samples can be found
+in the samples directory.</p>
+<p>If you need a project to be created for Eclipse or Intellij IDEA use the
+maven commands</p>
+<p>
+<source>maven eclipse</source> </p>
+<p><source>maven idea</source> </p>
<p> </p>
<p> </p>
<p> </p>
1.2 +114 -112 ws-sandesha/xdocs/images/Architecture2.jpg
<<Binary file>>
1.3 +238 -184 ws-sandesha/xdocs/images/ServerClass.jpg
<<Binary file>>
1.2 +103 -69 ws-sandesha/xdocs/images/ServerReqWithAsyncAck.png
<<Binary file>>
1.2 +64 -70 ws-sandesha/xdocs/images/ServerReqWithSyncAck.png
<<Binary file>>
1.2 +129 -126 ws-sandesha/xdocs/images/ServerWithResponse.png
<<Binary file>>
1.2 +110 -107 ws-sandesha/xdocs/images/ServerWithResponseSyncAck.png
<<Binary file>>
---------------------------------------------------------------------
To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: sandesha-dev-help@ws.apache.org