You are viewing a plain text version of this content. The canonical link for it is here.
Posted to sandesha-dev@ws.apache.org by ch...@apache.org on 2007/04/23 11:55:16 UTC

svn commit: r531400 [13/18] - in /webservices/sandesha/trunk/java/modules: client/ core/ core/src/ core/src/main/ core/src/main/java/ core/src/main/java/org/ core/src/main/java/org/apache/ core/src/main/java/org/apache/sandesha2/ core/src/main/java/org...

Added: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/UsesSequenceSTR.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/UsesSequenceSTR.java?view=auto&rev=531400
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/UsesSequenceSTR.java (added)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/UsesSequenceSTR.java Mon Apr 23 02:54:53 2007
@@ -0,0 +1,121 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ * Copyright 2006 International Business Machines Corp.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
+package org.apache.sandesha2.wsrm;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMException;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMNamespace;
+import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.axiom.soap.SOAPFactory;
+import org.apache.axiom.soap.SOAPHeader;
+import org.apache.axiom.soap.SOAPHeaderBlock;
+import org.apache.sandesha2.Sandesha2Constants;
+import org.apache.sandesha2.SandeshaException;
+import org.apache.sandesha2.i18n.SandeshaMessageHelper;
+import org.apache.sandesha2.i18n.SandeshaMessageKeys;
+
+/**
+ * Class which handles the UsesSequenceSTR header block
+ */
+public class UsesSequenceSTR implements IOMRMPart {
+	
+	private SOAPFactory defaultFactory;
+	private String namespaceValue = null;
+	
+	public UsesSequenceSTR(SOAPFactory factory,String namespaceValue) throws SandeshaException {
+		if (!isNamespaceSupported(namespaceValue))
+			throw new SandeshaException (SandeshaMessageHelper.getMessage(
+					SandeshaMessageKeys.unknownSpec,
+					namespaceValue));
+		
+		this.namespaceValue = namespaceValue;
+		this.defaultFactory = factory;
+	}
+
+	public String getNamespaceValue() {
+		return namespaceValue;
+	}
+
+	public Object fromOMElement(OMElement header) throws OMException {
+
+		OMFactory factory = header.getOMFactory();
+		if (factory==null)
+			factory = defaultFactory;
+		
+    // Set that we have processed the must understand
+    ((SOAPHeaderBlock)header).setProcessed();
+    
+		return this;
+	}
+
+	public OMElement toOMElement(OMElement header) throws OMException {
+
+		if (header == null || !(header instanceof SOAPHeader))
+			throw new OMException();
+
+		OMFactory factory = header.getOMFactory();
+		if (factory==null)
+			factory = defaultFactory;
+		
+		OMNamespace rmNamespace = factory.createOMNamespace(namespaceValue,Sandesha2Constants.WSRM_COMMON.NS_PREFIX_RM);
+		
+		SOAPHeader SOAPHeader = (SOAPHeader) header;
+		SOAPHeaderBlock sequenceAcknowledgementHeaderBlock = SOAPHeader.addHeaderBlock(
+				Sandesha2Constants.WSRM_COMMON.USES_SEQUENCE_STR,rmNamespace);
+		
+		if (sequenceAcknowledgementHeaderBlock == null)
+			throw new OMException("Cant set UsesSequenceSTR since the element is null");
+
+		// This header _must_ always be understood
+		sequenceAcknowledgementHeaderBlock.setMustUnderstand(true);
+
+		SOAPHeader.addChild(sequenceAcknowledgementHeaderBlock);
+
+		return header;
+	}
+
+	public void toSOAPEnvelope(SOAPEnvelope envelope) {
+		SOAPHeader header = envelope.getHeader();
+
+		if (header==null) {
+			SOAPFactory factory = (SOAPFactory)envelope.getOMFactory();
+			header = factory.createSOAPHeader(envelope);
+		}
+		
+		//detach if already exist.
+		OMElement elem = header.getFirstChildWithName(new QName(
+				namespaceValue, Sandesha2Constants.WSRM_COMMON.USES_SEQUENCE_STR));
+		if (elem != null)
+			elem.detach();
+
+		toOMElement(header);
+	}
+
+	public boolean isNamespaceSupported (String namespaceName) {
+		// This is only supported using the new namespace
+		if (Sandesha2Constants.SPEC_2007_02.NS_URI.equals(namespaceName))
+			return true;
+		
+		return false;
+	}
+
+}
\ No newline at end of file

Added: webservices/sandesha/trunk/java/modules/core/src/main/resources/org/apache/sandesha2/i18n/resource.properties
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/resources/org/apache/sandesha2/i18n/resource.properties?view=auto&rev=531400
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/resources/org/apache/sandesha2/i18n/resource.properties (added)
+++ webservices/sandesha/trunk/java/modules/core/src/main/resources/org/apache/sandesha2/i18n/resource.properties Mon Apr 23 02:54:53 2007
@@ -0,0 +1,239 @@
+# Translation instructions.
+# 1.  Each message line is of the form key=value.
+#     Translate the value, DO NOT translate the key.
+# 2.  The messages may contain arguments that will be filled in
+#     by the runtime.  These are of the form: {0}, {1}, etc.
+#     These must appear as is in the message, though the order
+#     may be changed to support proper language syntax.
+# 3.  If a single quote character is to appear in the resulting
+#     message, it must appear in this file as two consecutive
+#     single quote characters.
+# 4.  Lines beginning with "#" (like this one) are comment lines
+#     and may contain translation instructions.  They need not be
+#     translated unless your translated file, rather than this file,
+#     will serve as a base for other translators.
+
+
+#-------------------------------------
+#
+#	General Sandesha messages
+#
+#-------------------------------------
+
+cannotInitInMemoryStorageManager=Cannot initialize the given in-memory storage manager due to exception {0}.
+cannotInitPersistentStorageManager=Cannot initialize the given persistent storage manager due to exception {0}.
+cannotProceedDueToStorageManager=Sandesha2 Internal Error: the StorageManager is not available due to exception {0}.
+cannotGetStorageKey=Sandesha2 Internal Error: could not obtain the sandesha2 storage key in order to store the message.
+cannotGetStorageManager=Sandesha2 Internal Error: could not load the specified storage manager. 
+storageManagerMustImplement=StorageManager {0} must implement the org.apache.sandesha2.storage.StorageManager interface.
+cannotInitSecurityManager=Cannot initialize the given security manager due to exception {0}.
+securityManagerMustImplement=SecurityManager {0} must implement the org.apache.sandesha2.storage.StorageManager interface.
+cannotFindModulePolicies=No policies were found in the module.xml at the module initiation time.
+cannotPauseThread=Cannot pause a non-running thread.
+
+commitError=Exception thrown when trying to commit the transaction: {0}.
+rollbackError=Exception thrown when trying to rollback the transaction: {0}.
+deadlock=Sandesha2 Internal Error: deadlock detected. Transaction details ''{0}'', Bean details ''{1}''.
+noTransaction=Sandesha2 Internal Error: current thread does not have a transaction.
+inMsgError=Sandesha2 got an exception when processing an in message: {0}.
+outMsgError=Sandesha2 got an exception when processing an out message: {0}.
+invokeMsgError=Sandesha2 got an exception when invoking message: {0}.
+sendMsgError=Sandesha2 got an exception when sending a message: {0}.
+cannotSendMsgAsSequenceClosed=Sandesha2 could not send the message on sequence {0} as the sequence has been closed.
+cannotSendMsgAsSequenceTerminated=Sandesha2 could not send the message on sequence {0} as the sequence has been terminated.
+cannotSendMsgAsSequenceTimedout=Sandesha2 could not send the message on sequence {0} as the sequence has timed out.
+noValidSyncResponse=Sandesha2 sender thread has not received a valid synchronous response.
+classLoaderNotFound=Module class loader not found.
+
+defaultPropertyBeanNotSet=Sandesha2 Internal Error: ''DefaultPropertyBean'' is not set.
+propertyBeanNotSet=Sandesha2 Internal Error: ''PropertyBean'' is not set.
+optionsObjectNotSet=Sandesha2 Internal Error: ''Options'' object is not set.
+serviceContextNotSet=Sandesha2 Internal Error: ''ServiceContext'' is not set.
+sequenceIdBeanNotSet=Sandesha2 Internal Error: ''SequenceIdBean'' is not set.
+configContextNotSet=Sandesha2 Internal Error: ''ConfigurationContext'' is not set.
+soapEnvNotSet=Sandesha2 Internal Error:  SOAP envelope is not set.
+soapBodyNotPresent=Invalid SOAP message: the body is not present.
+unknownSoapVersion=Unknown SOAP version {0}.
+axisServiceIsNull=Sandesha2 Internal Error: ''AxisService'' is null.
+msgContextNotSet=Sandesha2 Internal Error: ''MessageContext'' is null.
+transportOutNotPresent=Sandesha2 Internal Error: original transport sender is not present.
+workAlreadyAssigned=Work ''{0}'' is already assigned to a different Worker. Will try the next one.
+couldNotFindOperation=Could not find operation for message type {0} and spec level {1}.
+cannotChooseAcksTo=Could not find an appropriate acksTo for the reply sequence, given inbound sequence {0} and bean info {1}.
+cannotChooseSpecLevel=Could not find an appropriate specification level for the reply sequence, given inbound sequence {0} and bean info {1}.
+
+invalidMsgNumber=Sandesha2 Internal Error: invalid message number {0}.
+nonUniqueResult=Sandesha2 Internal error: A search for a unique object resulted in several matches. Match 1 {0}, Match 2 {1}.
+invalidStringArray=Sandesha2 Internal error: invalid String array : {0}.
+cannotCointinueSender=Sandesha2 Internal error: cannot continue the Sender due to exception: {0}.
+sendHasUnavailableMsgEntry=Sandesha2 Internal error: sender has an unavailable message entry {0}.
+propertyInvalidValue=Sandesha2 Internal error: property {0} contains an invalid value.
+invalidRange=The specified range was invalid: {0}, {1}.
+
+policyBeanNotFound=Cant find a Sandesha2 policy bean.
+cloneDoesNotMatchToOriginal=The elements of the original and cloned SOAP Envelopes do not match.
+exceptionInFlowCompletion=Got exception in flowCompletion of SandeshaInHandler.
+rmdBeanNotFound=RMDBean not available for the sequence:{0}.
+policyHasNotBeenSet="WSRM Policy ''{0}'' has not been set for this endpoint.
+rmEnforceFailure=The message with MessageID ''{0}'' is not WSRM enabled but the service enforces WSRM.
+referenceMessageNotSetForSequence=ReferenceMessage has not been set for the sequence ''{0}''
+moduleNotSet=Sandesha Module has not been set at the initiation
+
+#-------------------------------------
+#
+#	Protocol Oriented Messages
+#
+#-------------------------------------
+
+rmNamespaceNotMatchSequence=Validation failed. The RM namespace value {0} of the message does not match {1} for sequence {2}.
+unknownWSAVersion=Unknown WS-Addressing version {0}.
+emptyAckRequestSpecLevel=Empty AckRequest messages can only be sent with the v1_1 spec. You are using spec version {0}.
+closeSequenceSpecLevel=Close sequence messages can only be sent with the v1_1 spec. You are using spec version {0}.
+unknownSpec=Unknown specification version {0}.
+unknownRMNamespace=Unknown rm namespace value {0}.
+unknownNamespace=Unsupported namespace {0}.
+cannotDecideRMVersion=Message does not has a valid RM namespace value - cannot decide the RM version.
+specDoesNotSupportElement=Spec ''{0}'' does not support the element {1}.
+couldNotSendCreateSeqResponse=Could not send a CreateSequenceResponse message due to exception {0}.
+
+couldNotSendTerminate=Could not send the terminate message due to error {0}.
+couldNotSendClose=Could not send the close sequence message due to error {0}.
+couldNotSendTerminateResponse=Could not send the terminate sequence response.  Check linked exception for details.
+couldNotSendCloseResponse=Could not send the CloseSequenceResponse due to exception {0}.
+couldNotSendTerminateSeqNotFound=Internal sequenceID {0} was not found: cannot send the terminate message.
+cannotSendAckRequestException=Could not send the ackRequest message on sequence {0} due to an exception: {1}
+ackRequestMultipleParts=Passed message has more than one AckRequest. You can have only one.
+noAckRequestPartFound=No AckRequested part was present in the message.
+noSequenceEstablished=A sequence with the given sequence ID {0} has not been established, has been terminated or could not be found.
+invalidInternalSequenceID=Sandesha2 Internal Error: The internal sequence ID {0} is not valid.
+createSeqEntryNotFound=''Create Sequence'' entry is not found.
+
+toEPRNotValid=The ''To'' endpoint reference address is not set correctly: {0}.
+cannotFindSequence=Cannot find the sequence with ID {0}.
+msgNumberMustBeLargerThanZero=Message number {0} is invalid: this value has to be larger than zero.
+msgNumberNotLargerThanLastMsg=The message number {0} is not larger than the last message sent on this sequence {1}.
+msgNumberLargerThanLastMsg=The message number {0} is larger than the value {1}, which was previously declared as the last message.
+ackInvalidNotSent=The SequenceAcknowledgement received is invalid as the acknowledgement contains messages that have not been sent.
+cannotHaveFinalWithNack=The ''Final'' element cannot be present when there are Nack elements under the SequenceAcknowledgement.
+accptButNoSequenceOffered=Error: An ''accept'' was received but there was no offered sequence entry.
+relatesToNotAvailable: Invalid create sequence message: ''RelatesTo'' part is not available.
+cannotDerriveAckInterval=Cannot derive the ''Acknowledgement Interval'' from the passed string {0}.
+cannotDerriveRetransInterval=Cannot derive the ''Retransmission Interval'' from the passed string {0}.
+cannotDerriveInactivityTimeout=Cannot derive the ''Inactivity Timeout'' from the passed string {0}.
+noCreateSeqParts=No ''CreateSequence'' part is present in the create sequence message.
+noAcceptPart=An ''Accept'' part has not been generated for the ''create sequence request'' with an offer part.
+noAcksToPartInCreateSequence=No ''AcksTo'' part is present in the create sequence message.
+tempSeqIdNotSet=Error: ''TempSequenceId'' is not set.
+ackRandDoesNotHaveCorrectValues=The ack range {0} does not have correct values for Upper and Lower attributes.
+cannotSetAckRangeNullElement=Cannot set Ack Range part since element is null.
+acksToStrNotSet=acksToStr Seqeunce property is not set correctly.
+invalidSequenceID=invalid sequence ID: {0}.
+cantSendMakeConnectionNoTransportOut=Can''t send the MakeConnection reply since the message does not has a TransportOutDescription.
+makeConnectionDisabled=Cannot handle synchronous 2-way connections because MakeConnection is not enabled. Either enable MakeConnection or reconfigure your application to use asynchronous connections.
+
+noCreateSeqResponse=''CreateSequenceResponse'' part is not available.
+noTerminateSeqPart=''Terminate Sequence'' part is not available.
+noNackInSeqAckPart=Passed ''sequence ack'' element does not contain a ''nack'' part. {0}.
+nackDoesNotContainValidLongValue=''Nack'' element does not contain a valid long value {0}.
+noneNotAllowedNamespace=The given namespace {0} does not allow the ''None'' part to be added to the ''sequenceAcknowledgement'' element.
+noneNotAllowedAckRangesPresent=The ''None'' element cannot be present when there are acknowledgement range elements under the ''sequenceAcknowledgement'' element.
+noneNotAllowedNackPresent=The ''None'' element cannot be present when there are Nack elements under the ''sequenceAcknowledgement'' element.
+finalNotAllowedNamespace=The given namespace {0} does not allow the 'Final' part to be added to the ''sequenceAcknowledgement'' element.
+noSeqFaultInElement=The passed element {0} does not contain a ''Sequence Fault'' element.
+noSeqOfferInElement=The passed element {0} does not contain a ''SequenceOffer'' part.
+noTerminateSeqInElement=The passed element {0} does not contain a ''terminate sequence'' part.
+noTerminateSeqResponseInElement=The passed element {0} does not contain a ''terminate sequence response'' part.
+noAcceptPartInElement=The passed element {0} does not contain an ''Accept'' part.
+noUpperOrLowerAttributesInElement=The passed element {0} does not contain upper or lower attributes.
+noSequencePartInElement=The passed element {0} does not contain a ''Sequence'' part.
+noLastMessagePartInElement=The passed element {0} does not contain a ''Last Message'' part.
+noFinalPartInElement=The passed element {0} does not contain a ''Final'' part. 
+noNonePartInElement=The passed element {0} does not contain a ''None'' part.
+noCloseSequencePartInElement=The passed element {0} does not contain a ''close sequence'' part.
+noMessageNumberPartInElement=The passed sequnce element {0} does not contain a ''message number'' part.
+noCloseSeqResponsePartInElement=The passed element {0} does not contain a ''close sequence response'' part.
+noExpiresPartInElement=The passed elemenet {0} does not contain an ''Expires'' part.
+noCreateSeqPartInElement=The passed element {0} does not contain a ''create sequence'' part.
+noCreateSeqResponsePartInElement=The passed element {0} does not contain a ''create seqence response'' part.
+noFaultCodePart=The passed element {0} does not contain a ''Fault Code'' part.
+cannotFindAddressElement=Cannot find an ''Address'' part in the given element {0}.
+cannotFindAddressText=The passed element {0} does not have a valid address text.
+nullPassedElement=The passed element is null.
+seqPartIsNull=Sequence part is null.
+incomingSequenceNotValidID=The ID for the incoming sequence is not valid: ''{0}''.
+
+seqFaultCannotBeExtractedToNonHeader=Cannot extract ''Sequence Fault'' part from a non-header element.
+seqElementCannotBeAddedToNonHeader=''Sequence'' element cannot be added to non-header element.
+ackRequestedCannotBeAddedToNonHeader=''Ack Requested'' part cannot be added to a non-header element.
+terminateSeqCannotBeAddedToNonBody=Cannot add ''terminate sequence'' to a non-body element.
+terminateSeqResponseCannotBeAddedToNonBody=Cannot add ''terminate sequence response'' to a non-body element.
+closeSeqCannotBeAddedToNonBody=Cannot add ''close sequence'' to a non-body element.
+closeSeqResponseCannotBeAddedToNonBody=Cannot add ''close sequence response'' to a non-body element.
+createSeqCannotBeAddedToNonBody=Cannot add ''create sequence'' part to a non-body element.
+createSeqResponseCannotBeAddedToNonBody=Cannot get ''create sequnce response'' from a non-body element.
+closeSeqPartNullID=Cannot add ''close sequence'' part since identifier is not set.
+closeSeqResponsePartNullID=Cannot add ''close sequence response'' part since identifier is not set.
+invalidIdentifier=The passed element {0} does not contain a valid identifier part.
+ackRequestNullID=Cannot add ''ack request'' part since the identifier is not set.
+createSeqNullAcksTo=Cannot add a ''create seqeunce part'' since ''acksTo'' is not set.
+acceptNullAcksTo=Cannot add ''Accept'' part since ''acksTo'' is not set.
+noAcksToPart=The passed element {0} does not contain an ''acksTo'' part.
+cannotProcessExpires=Cannot process ''Expires'' since the duration value is not valid.
+noFaultCode=Cannot add ''Fault Code'' since the the value is not set correctly.
+
+cannotSetACksTo=Cannot set the of the AcksTo element address as the value is not valid {0}.
+cannotSetEndpoint=Cannot set the address of the Elndpoint element as the value is not valid {0}.
+setAValidMsgNumber=Set A Valid Message Number {0}.
+addressNotValid=Cannot set the address - the address value is not valid.
+
+elementMustForSpec=Element ''{0}'' must be present for the spec ''{1}''.
+
+#-------------------------------------
+#
+#	Client messages
+#
+#-------------------------------------
+
+incommingSequenceReportNotFound=An incoming sequence report is not present for the given sequenceID {0}.
+cannotFindReportForGivenData=Cannnot find a sequence report for the given data {0}.
+
+outSeqIDIsNull=''OutSequenceId'' is null.
+requestMsgNotPresent=Request message is not present.
+newSeqIdIsNull=New sequence Id is null.
+terminateAddedPreviously=Terminate was added previously.
+nullMsgId=Key (MessageId) is null. Cannot insert.
+failedToStoreMessage=Failed to store message due to exception {0}.
+failedToLoadMessage=Failed to load message due to exception {0}.
+entryNotPresentForUpdating=Entry is not present for updating.
+appMsgIsNull=Application message is null.
+cannotFindReqMsgFromOpContext=Cannot find the request message from the operation context.
+toEPRNotSet=To EPR has not been set in the given message.
+toBeanNotSet=The 'To' Sequence Property Bean has not been set for the sequence.
+cannotFindTransportInDesc=Cannot find the transport in description {0} in the ConfigurationContext.
+invalidElementFoundWithinElement=Found invalid ''{0}'' element within ''{1}'' element.
+invokerNotFound=An invoker thread was not found to dispatch messages on the inbound sequence {0}.
+cannotSetPolicyBeanServiceNull=Cannot set the given SandeshaPolicyBean since the AxisService is not present
+
+#------------------
+# Security messages
+#------------------
+secureDummyNoProof="Dummy security manager cannot check proof of possession"
+secureDummyNoToken="Dummy security manager cannot serialise or recover security tokens"
+secureDummyNoSTR  ="Dummy security manager cannot parse or write security token references"
+
+
+errorRetrievingSecurityToken = Error retrieving security token from token storage.
+proofOfPossessionNotVerified = Proof of possession not verified.
+noSecurityResults = No Security results.
+noSecConvTokenInPolicy = No SecureConversationToken in policy.
+
+couldNotLoadModulePolicies=Could not load module policies. Using default values.
+modulePoliciesLoaded=Module policies were successfully loaded.
+
+referencedMessageNotFound = Reference message is not present for the sequence with property key {0}
+createSequenceRefused=The Create Sequence request has been refused by the RM Destination
+messageNumberRollover=The maximum value for wsrm:MessageNumber has been exceeded.
+sequenceTerminatedFault=The Sequence has been terminated due to an unrecoverable error.
+unknownSequenceFault=The value of wsrm:Identifier is not a known Sequence identifier.
+invalidAckFault=The SequenceAcknowledgement violates the cumulative Acknowledgement invariant.
+cannotAcceptMsgAsSequenceClosedFault=The Sequence is closed and can not accept new messages. 

Added: webservices/sandesha/trunk/java/modules/interop/pom.xml
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/interop/pom.xml?view=auto&rev=531400
==============================================================================
--- webservices/sandesha/trunk/java/modules/interop/pom.xml (added)
+++ webservices/sandesha/trunk/java/modules/interop/pom.xml Mon Apr 23 02:54:53 2007
@@ -0,0 +1,46 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <parent>
+	<groupId>org.apache.sandesha2</groupId>
+	<artifactId>sandesha2</artifactId>
+        <version>SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>sandesha2-interop</artifactId>
+    <packaging>jar</packaging>
+    <version>SNAPSHOT</version>
+    <name>Sandesha - Interop</name>
+
+    <build>
+        <sourceDirectory>src/main/java</sourceDirectory>
+        <testSourceDirectory>src/main/java</testSourceDirectory>
+        <resources>
+            <resource>
+                <directory>src/main/resources</directory>
+            </resource>
+        </resources>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>1.4</source>
+                    <target>1.4</target>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+   
+    <dependencies>
+    	<dependency>
+            <groupId>org.apache.sandesha2</groupId>
+            <artifactId>sandesha2-core</artifactId>
+            <version>SNAPSHOT</version>
+        </dependency>
+
+    </dependencies>
+
+</project>

Added: webservices/sandesha/trunk/java/modules/mar/module.xml
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/mar/module.xml?view=auto&rev=531400
==============================================================================
--- webservices/sandesha/trunk/java/modules/mar/module.xml (added)
+++ webservices/sandesha/trunk/java/modules/mar/module.xml Mon Apr 23 02:54:53 2007
@@ -0,0 +1,146 @@
+<module name="sandesha2" class="org.apache.sandesha2.SandeshaModule">
+
+    <Description>
+        This module implements WS-ReliableMessaging for Axis2. This implements both the WSRM submitted spec and the new spec being developed under the OASIS WSRX group.
+    </Description>
+    
+    <InFlow>
+        <handler name="SandeshaGlobalInHandler" class="org.apache.sandesha2.handlers.SandeshaGlobalInHandler">
+            <!-- Global In handler should come before addressing dispatching -->
+            <order phase="Dispatch" before="AddressingBasedDispatcher" />
+        </handler> 
+        <handler name="SandeshaInHandler" class="org.apache.sandesha2.handlers.SandeshaInHandler">
+            <order phase="RMPhase"/>
+        </handler>
+    </InFlow>
+
+    <OutFlow>        
+        <handler name="SandeshaOutHandler" class="org.apache.sandesha2.handlers.SandeshaOutHandler">
+            <order phase="RMPhase"/>
+        </handler>   
+    </OutFlow>
+    
+    <InFaultFlow>        
+        <handler name="SandeshaGlobalInHandler" class="org.apache.sandesha2.handlers.SandeshaGlobalInHandler">
+            <!-- Global In handler should come before instance dispatching -->
+            <order phase="Dispatch" before="InstanceDispatcher" />
+        </handler> 
+        <handler name="SandeshaInHandler" class="org.apache.sandesha2.handlers.SandeshaInHandler">
+            <order phase="RMPhase"/>
+        </handler>
+    </InFaultFlow>
+    
+    <OutFaultFlow>        
+        <handler name="SandeshaOutHandler" class="org.apache.sandesha2.handlers.SandeshaOutHandler">
+            <order phase="RMPhase"/>
+        </handler>   
+    </OutFaultFlow>
+
+    <operation name="Sandesha2OperationInOnly" mep="http://www.w3.org/2006/01/wsdl/in-only">
+        <messageReceiver class="org.apache.sandesha2.msgreceivers.RMMessageReceiver"/>
+        
+        <!-- namespaces for the 2005-02 spec -->
+        <actionMapping>http://schemas.xmlsoap.org/ws/2005/02/rm/SequenceAcknowledgement</actionMapping>
+
+        <!-- namespaces for the 2007-02 spec -->
+        <actionMapping>http://docs.oasis-open.org/ws-rx/wsrm/200702/SequenceAcknowledgement</actionMapping>        
+        <actionMapping>http://docs.oasis-open.org/ws-rx/wsrm/200702/fault</actionMapping>
+
+        <!--  For interoparability perposes. Some WSRM implementations tend to send this as the LastMessage -->
+        <actionMapping>http://schemas.xmlsoap.org/ws/2005/02/rm/LastMessage</actionMapping>
+ 
+        <actionMapping>http://schemas.xmlsoap.org/ws/2005/02/rm/TerminateSequence</actionMapping>
+     </operation>
+ 
+     <operation name="Sandesha2OperationInOut" mep="http://www.w3.org/2006/01/wsdl/in-out">
+        <messageReceiver class="org.apache.sandesha2.msgreceivers.RMMessageReceiver"/>
+        
+        <!-- namespaces for the 2005-02 spec -->
+        <actionMapping>http://schemas.xmlsoap.org/ws/2005/02/rm/CreateSequence</actionMapping>
+        <actionMapping>http://schemas.xmlsoap.org/ws/2005/02/rm/AckRequested</actionMapping>
+        
+        <actionMapping>http://docs.oasis-open.org/ws-rx/wsrm/200702/AckRequested</actionMapping>
+        
+        <!-- namespaces for the 2007-02 spec -->
+        <actionMapping>http://docs.oasis-open.org/ws-rx/wsrm/200702/CreateSequence</actionMapping>
+        <actionMapping>http://docs.oasis-open.org/ws-rx/wsrm/200702/CloseSequence</actionMapping>
+        <actionMapping>http://docs.oasis-open.org/ws-rx/wsrm/200702/TerminateSequence</actionMapping>
+        <actionMapping>http://docs.oasis-open.org/ws-rx/wsmc/200702/MakeConnection</actionMapping>
+    </operation>
+
+    <operation name="Sandesha2OperationOutOnly" mep="http://www.w3.org/2006/01/wsdl/out-only">
+        <messageReceiver class="org.apache.sandesha2.msgreceivers.RMMessageReceiver"/>
+    </operation>
+    <operation name="Sandesha2OperationOutIn" mep="http://www.w3.org/2006/01/wsdl/out-in">
+        <messageReceiver class="org.apache.sandesha2.msgreceivers.RMMessageReceiver"/>
+    </operation>
+
+    <operation name="Sandesha2OperationDuplicate" mep="http://www.w3.org/2006/01/wsdl/in-out">
+        <messageReceiver class="org.apache.sandesha2.msgreceivers.RMMessageReceiver"/>
+    </operation>
+
+   <supported-policy-namespaces namespaces="http://ws.apache.org/sandesha2/policy" />
+
+	<wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
+			xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
+			xmlns:sandesha2="http://ws.apache.org/sandesha2/policy" wsu:Id="RMPolicy">
+		<sandesha2:RMAssertion>
+			<wsp:Policy>
+				<sandesha2:AcknowledgementInterval>3000</sandesha2:AcknowledgementInterval>
+	
+				<sandesha2:RetransmissionInterval>6000</sandesha2:RetransmissionInterval>
+	      
+	      <!-- '-1' conveys that there is no limit to the max. number of retransmissions.-->
+				<sandesha2:MaximumRetransmissionCount>10</sandesha2:MaximumRetransmissionCount>
+	
+				<sandesha2:ExponentialBackoff>false</sandesha2:ExponentialBackoff>
+	
+				<sandesha2:InactivityTimeout>60</sandesha2:InactivityTimeout>
+
+				<sandesha2:InactivityTimeoutMeasure>seconds</sandesha2:InactivityTimeoutMeasure>
+
+          <!-- Once a sequence has been marked as deleted, or timed out, this is the length of time that the
+               sequence will remain before all sequence state is totally removed -->
+                <sandesha2:SequenceRemovalTimeout>600</sandesha2:SequenceRemovalTimeout>
+
+                <sandesha2:SequenceRemovalTimeoutMeasure>seconds</sandesha2:SequenceRemovalTimeoutMeasure>
+
+				<sandesha2:InvokeInOrder>true</sandesha2:InvokeInOrder>
+	      
+	      <!-- These will not be overriden by service level policies -->
+				<sandesha2:MessageTypesToDrop>none</sandesha2:MessageTypesToDrop>  
+	                              
+	      <!-- This will not be overriden by service level policies -->
+				<sandesha2:StorageManagers>
+	
+					<sandesha2:InMemoryStorageManager>
+					  org.apache.sandesha2.storage.inmemory.InMemoryStorageManager
+					</sandesha2:InMemoryStorageManager>
+	
+					<sandesha2:PermanentStorageManager>
+					  org.apache.sandesha2.storage.inmemory.InMemoryStorageManager
+					</sandesha2:PermanentStorageManager>
+	
+				</sandesha2:StorageManagers>
+	      
+	      <!-- This will not be overriden by service level policies -->
+				<sandesha2:SecurityManager>org.apache.sandesha2.security.dummy.DummySecurityManager</sandesha2:SecurityManager>
+				
+				<sandesha2:MakeConnection>
+				  <sandesha2:Enabled>true</sandesha2:Enabled>
+				  <sandesha2:UseRMAnonURI>true</sandesha2:UseRMAnonURI>
+				</sandesha2:MakeConnection>
+				
+				<!-- <sandesha2:UseMessageSerialization>true</sandesha2:UseMessageSerialization> -->
+				
+				<sandesha2:EnforceRM>false</sandesha2:EnforceRM>
+			</wsp:Policy>
+		</sandesha2:RMAssertion>
+	</wsp:Policy>
+
+
+    <!-- Parameters that will be copied when creating related MessageContexts -->
+    <parameter name="propertiesToCopyFromReferenceMessage" locked="false">TransportURL,WSAddressingVersion,disableAddressingForOutMessages,rampartPolicy,RECV_RESULTS,PROXY</parameter>
+    <parameter name="propertiesToCopyFromReferenceRequestMessage" locked="false">WSAddressingVersion,RECV_RESULTS,rampartPolicy</parameter>
+
+</module>

Added: webservices/sandesha/trunk/java/modules/mar/pom.xml
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/mar/pom.xml?view=auto&rev=531400
==============================================================================
--- webservices/sandesha/trunk/java/modules/mar/pom.xml (added)
+++ webservices/sandesha/trunk/java/modules/mar/pom.xml Mon Apr 23 02:54:53 2007
@@ -0,0 +1,83 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <parent>
+	<groupId>org.apache.sandesha2</groupId>
+	<artifactId>sandesha2</artifactId>
+        <version>SNAPSHOT</version>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.apache.sandesha2</groupId>
+    <artifactId>sandesha2-mar</artifactId>
+    <packaging>mar</packaging>
+    <version>SNAPSHOT</version>
+    <name>Sandesha - Mar</name>
+
+
+    <build>
+        <sourceDirectory>src/main/java</sourceDirectory>
+        <testSourceDirectory>src/main/java</testSourceDirectory>
+        <resources>
+            <resource>
+                <directory>src/main/resources</directory>
+            </resource>
+        </resources>
+        <plugins>
+
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-antrun-plugin</artifactId>
+                <version>1.1</version>
+                <executions>
+                    <execution>
+                        <id>create-test-resources</id>
+                        <phase>process-test-resources</phase>
+                        <configuration>
+                            <tasks>
+                                <!--copy jboss client jars into service archive-->
+                                <copydir src="../core/target/classes"
+                                      dest="target/classes"/>
+                            </tasks>
+                        </configuration>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>		
+
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>1.4</source>
+                    <target>1.4</target>
+                </configuration>
+            </plugin>
+	    <plugin>
+        	<groupId>org.apache.axis2.maven2</groupId>
+        	<artifactId>axis2-mar-maven-plugin</artifactId>
+        	<version>SNAPSHOT</version>
+        	<extensions>true</extensions>
+        	<configuration>
+       	  		<includeDependencies>false</includeDependencies>
+			<moduleXmlFile>module.xml</moduleXmlFile>
+        	</configuration>
+      	     </plugin> 
+           </plugins>
+
+    </build>
+    
+    <dependencies>
+    	<dependency>
+            <groupId>org.apache.sandesha2</groupId>
+            <artifactId>sandesha2-core</artifactId>
+            <version>SNAPSHOT</version>
+        </dependency>
+    </dependencies>
+
+</project>

Added: webservices/sandesha/trunk/java/modules/policy/pom.xml
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/policy/pom.xml?view=auto&rev=531400
==============================================================================
--- webservices/sandesha/trunk/java/modules/policy/pom.xml (added)
+++ webservices/sandesha/trunk/java/modules/policy/pom.xml Mon Apr 23 02:54:53 2007
@@ -0,0 +1,77 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <parent>
+	<groupId>org.apache.sandesha2</groupId>
+	<artifactId>sandesha2</artifactId>
+        <version>SNAPSHOT</version>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.apache.sandesha2</groupId>
+    <artifactId>sandesha2-policy</artifactId>
+    <packaging>jar</packaging>
+    <version>SNAPSHOT</version>
+    <name>Sandesha - policy</name>
+
+    <build>
+        <sourceDirectory>src/main/java</sourceDirectory>
+        <testSourceDirectory>src/main/java</testSourceDirectory>
+        <resources>
+            <resource>
+                <directory>src/main/resources</directory>
+            </resource>
+        </resources>
+        <plugins>
+
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-antrun-plugin</artifactId>
+                <version>1.1</version>
+                <executions>
+                    <execution>
+                        <id>create-test-resources</id>
+                        <phase>process-test-resources</phase>
+                        <configuration>
+                            <tasks>
+                                <!--copy class files required for policy jar from core module-->
+				<copy todir="target/classes">
+				   <fileset dir="../core/target/classes" includes="**/policy/**/*.class"/>
+				   <fileset dir="../core/target/classes" includes="**/*.properties"/>
+				   <fileset dir="../core/target/classes" includes="org/apache/sandesha2/i18n/**" />
+				   <fileset dir="../core/target/classes" includes="**/*Sandesha2Constants*.class"/>
+				   <fileset dir="../core/target/classes" includes="**/*SandeshaException*.class"/>
+				</copy>
+                            </tasks>
+                        </configuration>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>		
+
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>1.4</source>
+                    <target>1.4</target>
+                </configuration>
+            </plugin>
+           </plugins>
+
+    </build>
+    
+    <dependencies>
+    	<dependency>
+            <groupId>org.apache.sandesha2</groupId>
+            <artifactId>sandesha2-core</artifactId>
+            <version>SNAPSHOT</version>
+        </dependency>
+    </dependencies>
+
+</project>

Added: webservices/sandesha/trunk/java/modules/policy/src/main/resources/META-INF/services/org.apache.neethi.builders.AssertionBuilder
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/policy/src/main/resources/META-INF/services/org.apache.neethi.builders.AssertionBuilder?view=auto&rev=531400
==============================================================================
--- webservices/sandesha/trunk/java/modules/policy/src/main/resources/META-INF/services/org.apache.neethi.builders.AssertionBuilder (added)
+++ webservices/sandesha/trunk/java/modules/policy/src/main/resources/META-INF/services/org.apache.neethi.builders.AssertionBuilder Mon Apr 23 02:54:53 2007
@@ -0,0 +1 @@
+org.apache.sandesha2.policy.builders.RMAssertionBuilder
\ No newline at end of file

Added: webservices/sandesha/trunk/java/modules/samples/conf/userguide/AsyncEchoClient.bat
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/samples/conf/userguide/AsyncEchoClient.bat?view=auto&rev=531400
==============================================================================
--- webservices/sandesha/trunk/java/modules/samples/conf/userguide/AsyncEchoClient.bat (added)
+++ webservices/sandesha/trunk/java/modules/samples/conf/userguide/AsyncEchoClient.bat Mon Apr 23 02:54:53 2007
@@ -0,0 +1,6 @@
+@echo off
+setlocal EnableDelayedExpansion
+set SANDESHA2_CLASS_PATH=.\UserguideSampleClients.jar
+FOR %%c in (.\lib\*.jar) DO set SANDESHA2_CLASS_PATH=!SANDESHA2_CLASS_PATH!;%%c
+
+java -cp %SANDESHA2_CLASS_PATH% sandesha2.samples.userguide.AsyncEchoClient .\
\ No newline at end of file

Added: webservices/sandesha/trunk/java/modules/samples/conf/userguide/AsyncEchoClient.sh
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/samples/conf/userguide/AsyncEchoClient.sh?view=auto&rev=531400
==============================================================================
--- webservices/sandesha/trunk/java/modules/samples/conf/userguide/AsyncEchoClient.sh (added)
+++ webservices/sandesha/trunk/java/modules/samples/conf/userguide/AsyncEchoClient.sh Mon Apr 23 02:54:53 2007
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+export SANDESHA2_CLASS_PATH=./UserguideSampleClients.jar
+for f in ./lib/*.jar
+do
+  SANDESHA2_CLASS_PATH=$SANDESHA2_CLASS_PATH:$f
+done
+
+java -cp $SANDESHA2_CLASS_PATH sandesha2.samples.userguide.AsyncEchoClient ./

Added: webservices/sandesha/trunk/java/modules/samples/conf/userguide/AsyncPingClient.bat
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/samples/conf/userguide/AsyncPingClient.bat?view=auto&rev=531400
==============================================================================
--- webservices/sandesha/trunk/java/modules/samples/conf/userguide/AsyncPingClient.bat (added)
+++ webservices/sandesha/trunk/java/modules/samples/conf/userguide/AsyncPingClient.bat Mon Apr 23 02:54:53 2007
@@ -0,0 +1,6 @@
+@echo off
+setlocal EnableDelayedExpansion
+set SANDESHA2_CLASS_PATH=.\UserguideSampleClients.jar
+FOR %%c in (.\lib\*.jar) DO set SANDESHA2_CLASS_PATH=!SANDESHA2_CLASS_PATH!;%%c
+
+java -cp %SANDESHA2_CLASS_PATH% sandesha2.samples.userguide.AsyncPingClient .\
\ No newline at end of file

Added: webservices/sandesha/trunk/java/modules/samples/conf/userguide/AsyncPingClient.sh
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/samples/conf/userguide/AsyncPingClient.sh?view=auto&rev=531400
==============================================================================
--- webservices/sandesha/trunk/java/modules/samples/conf/userguide/AsyncPingClient.sh (added)
+++ webservices/sandesha/trunk/java/modules/samples/conf/userguide/AsyncPingClient.sh Mon Apr 23 02:54:53 2007
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+export SANDESHA2_CLASS_PATH=./UserguideSampleClients.jar
+for f in ./lib/*.jar
+do
+  SANDESHA2_CLASS_PATH=$SANDESHA2_CLASS_PATH:$f
+done
+
+java -cp $SANDESHA2_CLASS_PATH sandesha2.samples.userguide.AsyncPingClient ./

Added: webservices/sandesha/trunk/java/modules/samples/conf/userguide/SyncEchoClient.bat
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/samples/conf/userguide/SyncEchoClient.bat?view=auto&rev=531400
==============================================================================
--- webservices/sandesha/trunk/java/modules/samples/conf/userguide/SyncEchoClient.bat (added)
+++ webservices/sandesha/trunk/java/modules/samples/conf/userguide/SyncEchoClient.bat Mon Apr 23 02:54:53 2007
@@ -0,0 +1,6 @@
+@echo off
+setlocal EnableDelayedExpansion
+set SANDESHA2_CLASS_PATH=.\UserguideSampleClients.jar
+FOR %%c in (.\lib\*.jar) DO set SANDESHA2_CLASS_PATH=!SANDESHA2_CLASS_PATH!;%%c
+
+java -cp %SANDESHA2_CLASS_PATH% sandesha2.samples.userguide.SyncEchoClient .\
\ No newline at end of file

Added: webservices/sandesha/trunk/java/modules/samples/conf/userguide/SyncEchoClient.sh
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/samples/conf/userguide/SyncEchoClient.sh?view=auto&rev=531400
==============================================================================
--- webservices/sandesha/trunk/java/modules/samples/conf/userguide/SyncEchoClient.sh (added)
+++ webservices/sandesha/trunk/java/modules/samples/conf/userguide/SyncEchoClient.sh Mon Apr 23 02:54:53 2007
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+export SANDESHA2_CLASS_PATH=./UserguideSampleClients.jar
+for f in ./lib/*.jar
+do
+  SANDESHA2_CLASS_PATH=$SANDESHA2_CLASS_PATH:$f
+done
+
+java -cp $SANDESHA2_CLASS_PATH sandesha2.samples.userguide.SyncEchoClient ./

Added: webservices/sandesha/trunk/java/modules/samples/conf/userguide/SyncPingClient.bat
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/samples/conf/userguide/SyncPingClient.bat?view=auto&rev=531400
==============================================================================
--- webservices/sandesha/trunk/java/modules/samples/conf/userguide/SyncPingClient.bat (added)
+++ webservices/sandesha/trunk/java/modules/samples/conf/userguide/SyncPingClient.bat Mon Apr 23 02:54:53 2007
@@ -0,0 +1,6 @@
+@echo off
+setlocal EnableDelayedExpansion
+set SANDESHA2_CLASS_PATH=.\UserguideSampleClients.jar
+FOR %%c in (.\lib\*.jar) DO set SANDESHA2_CLASS_PATH=!SANDESHA2_CLASS_PATH!;%%c
+
+java -cp %SANDESHA2_CLASS_PATH% sandesha2.samples.userguide.SyncPingClient .\
\ No newline at end of file

Added: webservices/sandesha/trunk/java/modules/samples/conf/userguide/SyncPingClient.sh
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/samples/conf/userguide/SyncPingClient.sh?view=auto&rev=531400
==============================================================================
--- webservices/sandesha/trunk/java/modules/samples/conf/userguide/SyncPingClient.sh (added)
+++ webservices/sandesha/trunk/java/modules/samples/conf/userguide/SyncPingClient.sh Mon Apr 23 02:54:53 2007
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+export SANDESHA2_CLASS_PATH=./UserguideSampleClients.jar
+for f in ./lib/*.jar
+do
+  SANDESHA2_CLASS_PATH=$SANDESHA2_CLASS_PATH:$f
+done
+
+java -cp $SANDESHA2_CLASS_PATH sandesha2.samples.userguide.SyncPingClient ./

Added: webservices/sandesha/trunk/java/modules/samples/conf/userguide/services.xml
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/samples/conf/userguide/services.xml?view=auto&rev=531400
==============================================================================
--- webservices/sandesha/trunk/java/modules/samples/conf/userguide/services.xml (added)
+++ webservices/sandesha/trunk/java/modules/samples/conf/userguide/services.xml Mon Apr 23 02:54:53 2007
@@ -0,0 +1,46 @@
+<service name="RMSampleService">
+   <parameter name="ServiceClass" locked="xsd:false">sandesha2.samples.userguide.RMSampleService</parameter>
+
+
+
+    <description>
+        The userguide Sample service.
+    </description>
+
+    <module ref="sandesha2" />
+       
+    <operation name="ping" mep="http://www.w3.org/2006/01/wsdl/in-only">  
+        <messageReceiver class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver" />
+        <actionMapping>urn:wsrm:Ping</actionMapping>
+    </operation>
+    
+    <operation name="MTOMPing" mep="http://www.w3.org/2006/01/wsdl/in-only">  
+        <messageReceiver class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver" />
+    </operation>
+    
+    <operation name="echoString">
+        <messageReceiver class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver" />
+        <actionMapping>urn:wsrm:EchoString</actionMapping>
+        <outputActionMapping>urn:wsrm:EchoStringResponse</outputActionMapping>
+    </operation>
+       
+   <!--     
+   <supported-policy-namespaces namespaces="http://ws.apache.org/sandesha2/policy" />
+
+	<wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
+			xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
+			xmlns:sandesha2="http://ws.apache.org/sandesha2/policy" wsu:Id="RMPolicy">
+			
+		<sandesha2:RMAssertion>
+			<wsp:Policy>
+				<sandesha2:AcknowledgementInterval>4000</sandesha2:AcknowledgementInterval>
+				<sandesha2:EnforceRM>true</sandesha2:EnforceRM>
+			</wsp:Policy>
+		</sandesha2:RMAssertion>
+		
+	</wsp:Policy>
+	 -->
+    
+    
+</service>
+

Added: webservices/sandesha/trunk/java/modules/samples/conf/userguide/userguide_sample.html
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/samples/conf/userguide/userguide_sample.html?view=auto&rev=531400
==============================================================================
--- webservices/sandesha/trunk/java/modules/samples/conf/userguide/userguide_sample.html (added)
+++ webservices/sandesha/trunk/java/modules/samples/conf/userguide/userguide_sample.html Mon Apr 23 02:54:53 2007
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+       "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+  <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
+  <title>Sandesha2 Samples Guide</title>
+  <meta name="generator" content="amaya 9.2.2, see http://www.w3.org/Amaya/"
+  />
+</head>
+
+<body>
+<h1>How to run the userguide sample</h1>
+
+<h2>Setting up the server</h2>
+
+<p>Install tomcat and add the Axis2 web app.</p>
+
+<p>Add an user phase named RMPhase to both inFlow and outFlow of
+axis2.xml.</p>
+
+<p>Add the Sandesha2 module to the &lt;AXIS2_WEBAPP&gt;\WEB-INF\modules
+directory.</p>
+
+<p>Start tomcat.</p>
+
+<h2>Setting up the client</h2>
+
+<p>We have made a client repo available at the directory samples\clients
+directory of the Sandesha2 binary distribution.</p>
+
+<p>Add all the jar files that come with the lib directory of Apache Axis2
+binary distrubution to the samples\clients\lib directory.</p>
+
+<p>Add the Sandesha2 jar file that comes with the binary distribution to the
+samples\clients\lib directory.</p>
+
+<p>Add the addressing module file that comes with Apache Axis2 to the
+samples\clients\modules directory.</p>
+
+<p>Add the Sandesha2 module file that comes with Apache Sandesha2 binary
+distribution to samples\clients\modules directory.</p>
+
+<h2>Setting up the tcp monitor.</h2>
+
+<p>start the tcp monitor utility program and map following ports.</p>
+
+<p>8070 -&gt; 8080 (assuming that you started tomcat in the port 8080)</p>
+
+<p>9070 -&gt; 6060 (assuming that your Axis2 client port is 6060)</p>
+
+<h2>Running the sample clients</h2>
+
+<p>Simply double click the the bat files that come in the samples\client
+directory of the Sandesha2 binary distribution to run various samples clients
+and observe tcp monitor to see the message exchange.</p>
+</body>
+</html>

Added: webservices/sandesha/trunk/java/modules/samples/src/sandesha2/samples/simpleServer/SimpleSandesha2Server.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/samples/src/sandesha2/samples/simpleServer/SimpleSandesha2Server.java?view=auto&rev=531400
==============================================================================
--- webservices/sandesha/trunk/java/modules/samples/src/sandesha2/samples/simpleServer/SimpleSandesha2Server.java (added)
+++ webservices/sandesha/trunk/java/modules/samples/src/sandesha2/samples/simpleServer/SimpleSandesha2Server.java Mon Apr 23 02:54:53 2007
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package sandesha2.samples.simpleServer;
+
+import java.io.File;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
+import org.apache.axis2.transport.http.SimpleHTTPServer;
+
+public class SimpleSandesha2Server {
+
+	private static String SANDESHA2_HOME = "<SANDESHA2_HOME>"; //Change this to ur path.
+	
+	private static String AXIS2_SERVER_PATH = SANDESHA2_HOME + File.separator + "target" + File.separator +"repos" + File.separator + "server" + File.separator;   //this will be available after a maven build
+	
+	public static void main(String[] args) throws AxisFault {
+
+		String axisServerRepo = null;
+		if (args!=null && args.length>0)
+			axisServerRepo = args[0];
+		
+		if (axisServerRepo!=null && !"".equals(axisServerRepo)) {
+			AXIS2_SERVER_PATH = axisServerRepo;
+		}
+
+		if ("<SANDESHA2_HOME>".equals(SANDESHA2_HOME)){
+			System.out.println("ERROR: Please change <SANDESHA2_HOME> to your Sandesha2 installation directory.");
+			return;
+		}
+		
+		System.out.println("Starting sandesha2 server...");
+		
+		String axis2_xml = AXIS2_SERVER_PATH + "server_axis2.xml";
+		ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(AXIS2_SERVER_PATH,axis2_xml);
+		
+		SimpleHTTPServer server = new SimpleHTTPServer  (configContext,8080);
+		
+		server.start();
+	}
+}

Added: webservices/sandesha/trunk/java/modules/samples/src/sandesha2/samples/userguide/AnonEchoClient.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/samples/src/sandesha2/samples/userguide/AnonEchoClient.java?view=auto&rev=531400
==============================================================================
--- webservices/sandesha/trunk/java/modules/samples/src/sandesha2/samples/userguide/AnonEchoClient.java (added)
+++ webservices/sandesha/trunk/java/modules/samples/src/sandesha2/samples/userguide/AnonEchoClient.java Mon Apr 23 02:54:53 2007
@@ -0,0 +1,183 @@
+package sandesha2.samples.userguide;
+
+import java.io.File;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMNamespace;
+import org.apache.axiom.soap.SOAP12Constants;
+import org.apache.axiom.soap.SOAPBody;
+import org.apache.axis2.Constants;
+import org.apache.axis2.addressing.AddressingConstants;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
+import org.apache.axis2.client.async.AsyncResult;
+import org.apache.axis2.client.async.Callback;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
+import org.apache.axis2.context.MessageContextConstants;
+import org.apache.sandesha2.Sandesha2Constants;
+import org.apache.sandesha2.client.SandeshaClientConstants;
+import org.apache.sandesha2.util.SandeshaUtil;
+
+public class AnonEchoClient {
+	
+	private final static String applicationNamespaceName = "http://tempuri.org/"; 
+	private final static String echoString = "echoString";
+	private final static String Text = "Text";
+	private final static String Sequence = "Sequence";
+	private final static String echoStringResponse = "echoStringResponse";
+	private final static String EchoStringReturn = "EchoStringReturn";
+	
+	private String toIP = "127.0.0.1";
+	
+	private String toPort = "8070";
+	
+	private String transportToPort = "8070";
+	
+	private String toEPR = "http://" + toIP +  ":" + toPort + "/axis2/services/RMSampleService";
+	
+	private String transportToEPR = "http://" + toIP +  ":" + transportToPort + "/axis2/services/RMSampleService";
+	
+	private static String SANDESHA2_HOME = "<SANDESHA2_HOME>"; //Change this to ur path.
+	
+	private static String AXIS2_CLIENT_PATH = SANDESHA2_HOME + File.separator + "target" + File.separator +"repos" + File.separator + "client" + File.separator;   //this will be available after a maven build
+	
+	public static void main(String[] args) throws Exception {
+		
+		
+		String axisClientRepo = null;
+		if (args!=null && args.length>0)
+			axisClientRepo = args[0];
+		
+		if (axisClientRepo!=null && !"".equals(axisClientRepo)) {
+			AXIS2_CLIENT_PATH = axisClientRepo;
+			SANDESHA2_HOME = "";
+		}
+		
+		new AnonEchoClient ().run();
+	}
+	
+	private void run () throws Exception {
+		
+		if ("<SANDESHA2_HOME>".equals(SANDESHA2_HOME)){
+			System.out.println("ERROR: Please set the directory you unzipped Sandesha2 as the first option.");
+			return;
+		}
+
+		String axis2_xml = AXIS2_CLIENT_PATH + "client_axis2.xml";
+     
+		ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(AXIS2_CLIENT_PATH,axis2_xml);
+
+		ServiceClient serviceClient = new ServiceClient (configContext,null);	
+		
+		Options clientOptions = new Options ();
+		
+		clientOptions.setTo(new EndpointReference (toEPR));
+		
+		String sequenceKey = SandeshaUtil.getUUID();  //sequence key for thie sequence.
+		clientOptions.setProperty(SandeshaClientConstants.SEQUENCE_KEY,sequenceKey);
+		
+		clientOptions.setReplyTo(new EndpointReference (AddressingConstants.Submission.WSA_ANONYMOUS_URL));
+		
+		clientOptions.setProperty(MessageContextConstants.TRANSPORT_URL,transportToEPR);
+		
+		clientOptions.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);   //uncomment this to send messages in SOAP 1.2
+		
+		clientOptions.setProperty(AddressingConstants.WS_ADDRESSING_VERSION,AddressingConstants.Submission.WSA_NAMESPACE);
+		
+		clientOptions.setProperty(SandeshaClientConstants.OFFERED_SEQUENCE_ID,SandeshaUtil.getUUID());  //Uncomment this to offer a sequenceID for the incoming sequence.
+		
+		clientOptions.setAction("urn:wsrm:EchoString");
+		
+		clientOptions.setProperty(Constants.Configuration.USE_CUSTOM_LISTENER, Boolean.TRUE);
+		clientOptions.setProperty(SandeshaClientConstants.RM_SPEC_VERSION, Sandesha2Constants.SPEC_VERSIONS.v1_0);
+		
+		serviceClient.engageModule(new QName ("sandesha2"));
+		
+		//You must set the following two properties in the request-reply case.
+		clientOptions.setTransportInProtocol(Constants.TRANSPORT_HTTP);
+
+		//This asks Axis2 not to start a listner.
+		clientOptions.setUseSeparateListener(true);
+		
+		serviceClient.setOptions(clientOptions);
+
+		Callback callback1 = new TestCallback ("Callback 1");
+		serviceClient.sendReceiveNonBlocking(getEchoOMBlock("echo1",sequenceKey),callback1);
+		
+		Callback callback2 = new TestCallback ("Callback 2");
+		serviceClient.sendReceiveNonBlocking(getEchoOMBlock("echo2",sequenceKey),callback2);
+		
+		clientOptions.setProperty(SandeshaClientConstants.LAST_MESSAGE, "true");
+		
+		Callback callback3 = new TestCallback ("Callback 3");
+		serviceClient.sendReceiveNonBlocking(getEchoOMBlock("echo3",sequenceKey),callback3);
+		
+        while (!callback3.isComplete()) {
+            Thread.sleep(1000);
+        }
+        
+        Thread.sleep(5000);
+        
+	}
+
+	private static OMElement getEchoOMBlock(String text, String sequenceKey) {
+		OMFactory fac = OMAbstractFactory.getOMFactory();
+		OMNamespace applicationNamespace = fac.createOMNamespace(applicationNamespaceName,"ns1");
+		OMElement echoStringElement = fac.createOMElement(echoString, applicationNamespace);
+		OMElement textElem = fac.createOMElement(Text,applicationNamespace);
+		OMElement sequenceElem = fac.createOMElement(Sequence,applicationNamespace);
+		
+		textElem.setText(text);
+		sequenceElem.setText(sequenceKey);
+		echoStringElement.addChild(textElem);
+		echoStringElement.addChild(sequenceElem);
+		
+		return echoStringElement;
+	}
+
+	public class TestCallback extends Callback {
+
+		String name = null;
+		
+		public TestCallback () {
+			
+		}
+		
+		public TestCallback (String name) {
+			this.name = name;
+		}
+		
+		public void onComplete(AsyncResult result) {
+			//System.out.println("On Complete Called for " + text);
+			SOAPBody body = result.getResponseEnvelope().getBody();
+			
+			OMElement echoStringResponseElem = body.getFirstChildWithName(new QName (applicationNamespaceName,echoStringResponse));
+			if (echoStringResponseElem==null) { 
+				System.out.println("Error: SOAPBody does not have a 'echoStringResponse' child");
+				return;
+			}
+			
+			OMElement echoStringReturnElem = echoStringResponseElem.getFirstChildWithName(new QName (applicationNamespaceName,EchoStringReturn));
+			if (echoStringReturnElem==null) { 
+				System.out.println("Error: 'echoStringResponse' element does not have a 'EchoStringReturn' child");
+				return;
+			}
+			
+			String resultStr = echoStringReturnElem.getText();
+			System.out.println("Callback '" + name +  "' got result:" + resultStr);
+		}
+
+		public void onError (Exception e) {
+			System.out.println("Error reported for test call back");
+			e.printStackTrace();
+		}
+	}
+
+	
+}

Added: webservices/sandesha/trunk/java/modules/samples/src/sandesha2/samples/userguide/AsyncEchoBlockingClient.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/samples/src/sandesha2/samples/userguide/AsyncEchoBlockingClient.java?view=auto&rev=531400
==============================================================================
--- webservices/sandesha/trunk/java/modules/samples/src/sandesha2/samples/userguide/AsyncEchoBlockingClient.java (added)
+++ webservices/sandesha/trunk/java/modules/samples/src/sandesha2/samples/userguide/AsyncEchoBlockingClient.java Mon Apr 23 02:54:53 2007
@@ -0,0 +1,173 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package sandesha2.samples.userguide;
+
+import java.io.File;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMAttribute;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMNamespace;
+import org.apache.axiom.soap.SOAP11Constants;
+import org.apache.axiom.soap.SOAP12Constants;
+import org.apache.axis2.Constants;
+import org.apache.axis2.addressing.AddressingConstants;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
+import org.apache.axis2.context.MessageContextConstants;
+import org.apache.sandesha2.client.SandeshaClientConstants;
+import org.apache.sandesha2.util.SandeshaUtil;
+
+public class AsyncEchoBlockingClient {
+	
+	private final static String applicationNamespaceName = "http://tempuri.org/"; 
+	private final static String echoString = "echoString";
+	private final static String Text = "Text";
+	private final static String Sequence = "Sequence";
+	private final static String EchoStringReturn = "EchoStringReturn";
+	
+	private String toIP = "127.0.0.1";
+	
+	private String toPort = "8070";
+	
+	private String transportToPort = "8070";
+	
+	private String toEPR = "http://" + toIP +  ":" + toPort + "/axis2/services/RMSampleService";
+	
+	private String transportToEPR = "http://" + toIP +  ":" + transportToPort + "/axis2/services/RMSampleService";
+	
+	private static String SANDESHA2_HOME = "<SANDESHA2_HOME>"; //Change this to ur path.
+	
+	private static String AXIS2_CLIENT_PATH = SANDESHA2_HOME + File.separator + "target" + File.separator +"repos" + File.separator + "client" + File.separator;   //this will be available after a maven build
+	
+	public static void main(String[] args) throws Exception {
+		
+		
+		String axisClientRepo = null;
+		if (args!=null && args.length>0)
+			axisClientRepo = args[0];
+		
+		if (axisClientRepo!=null && !"".equals(axisClientRepo)) {
+			AXIS2_CLIENT_PATH = axisClientRepo;
+			SANDESHA2_HOME = "";
+		}
+		
+		new AsyncEchoBlockingClient ().run();
+	}
+	
+	private void run () throws Exception {
+		
+		if ("<SANDESHA2_HOME>".equals(SANDESHA2_HOME)){
+			System.out.println("ERROR: Please set the directory you unzipped Sandesha2 as the first option.");
+			return;
+		}
+
+		String axis2_xml = AXIS2_CLIENT_PATH + "client_axis2.xml";
+     
+		ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(AXIS2_CLIENT_PATH,axis2_xml);
+
+		ServiceClient serviceClient = new ServiceClient (configContext,null);	
+		
+		Options clientOptions = new Options ();
+		
+		clientOptions.setTo(new EndpointReference (toEPR));
+		
+		String acksTo = serviceClient.getMyEPR(Constants.TRANSPORT_HTTP).getAddress() + "/" + ServiceClient.ANON_OUT_IN_OP;
+		clientOptions.setProperty(SandeshaClientConstants.AcksTo,acksTo);
+		
+		String sequenceKey = "sequence4";
+		clientOptions.setProperty(SandeshaClientConstants.SEQUENCE_KEY,sequenceKey);
+		
+		clientOptions.setProperty(MessageContextConstants.TRANSPORT_URL,transportToEPR);
+		
+//		clientOptions.setProperty(MessageContextConstants.CHUNKED,Constants.VALUE_FALSE);   //uncomment this to send messages without chunking.
+		
+		clientOptions.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);   //uncomment this to send messages in SOAP 1.2
+		
+//		clientOptions.setProperty(SandeshaClient.RM_SPEC_VERSION,Sandesha2Constants.SPEC_VERSIONS.v1_1);  //uncomment this to send the messages according to the v1_1 spec.
+		
+		clientOptions.setProperty(AddressingConstants.WS_ADDRESSING_VERSION,AddressingConstants.Submission.WSA_NAMESPACE);
+		clientOptions.setProperty(SandeshaClientConstants.OFFERED_SEQUENCE_ID,SandeshaUtil.getUUID());  //Uncomment this to offer a sequenceID for the incoming sequence.
+		clientOptions.setAction("urn:wsrm:EchoString");
+		
+		//You must set the following two properties in the request-reply case.
+		clientOptions.setTransportInProtocol(Constants.TRANSPORT_HTTP);
+		clientOptions.setUseSeparateListener(true);
+		
+		serviceClient.setOptions(clientOptions);
+
+		clientOptions.setTimeOutInMilliSeconds(40000);
+		
+		OMElement result = serviceClient.sendReceive (getEchoOMBlock("echo1",sequenceKey));
+		showResult(result);
+		
+		result = serviceClient.sendReceive (getEchoOMBlock("echo2",sequenceKey));
+		showResult(result);
+		
+		result = serviceClient.sendReceive(getEchoOMBlock("echo3",sequenceKey));
+		showResult(result);
+		
+		result = serviceClient.sendReceive(getEchoOMBlock("echo4",sequenceKey));
+		showResult(result);
+		
+		clientOptions.setProperty(SandeshaClientConstants.LAST_MESSAGE, "true");
+		OMElement bodyElem = getEchoOMBlock("echo5",sequenceKey);
+		
+		result = serviceClient.sendReceive(bodyElem);
+		showResult(result);
+		        
+        Thread.sleep(4000);
+	}
+
+	private static OMElement getEchoOMBlock(String text, String sequenceKey) {
+		OMFactory fac = OMAbstractFactory.getOMFactory();
+		OMNamespace applicationNamespace = fac.createOMNamespace(applicationNamespaceName,"ns1");
+		OMElement echoStringElement = fac.createOMElement(echoString, applicationNamespace);
+		OMElement textElem = fac.createOMElement(Text,applicationNamespace);
+		OMElement sequenceElem = fac.createOMElement(Sequence,applicationNamespace);
+		
+		textElem.setText(text);
+		sequenceElem.setText(sequenceKey);
+		echoStringElement.addChild(textElem);
+		echoStringElement.addChild(sequenceElem);
+		
+		OMNamespace namespace = fac.createOMNamespace(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI,"env");
+		OMAttribute attr = fac.createOMAttribute("encodingStyle", namespace,"http://schemas.xmlsoap.org/soap/encoding/");
+		
+		echoStringElement.addAttribute(attr);
+		
+		return echoStringElement;
+	}
+
+    private void showResult (OMElement echoStringResponseElem) {
+		
+		OMElement echoStringReturnElem = echoStringResponseElem.getFirstChildWithName(new QName (applicationNamespaceName,EchoStringReturn));
+		if (echoStringReturnElem==null) { 
+			System.out.println("Error: 'echoStringResponse' element does not have a 'EchoStringReturn' child");
+			return;
+		}
+		
+		String resultStr = echoStringReturnElem.getText();
+		System.out.println("Got result:" + resultStr);
+    }	
+}

Added: webservices/sandesha/trunk/java/modules/samples/src/sandesha2/samples/userguide/AsyncEchoClient.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/samples/src/sandesha2/samples/userguide/AsyncEchoClient.java?view=auto&rev=531400
==============================================================================
--- webservices/sandesha/trunk/java/modules/samples/src/sandesha2/samples/userguide/AsyncEchoClient.java (added)
+++ webservices/sandesha/trunk/java/modules/samples/src/sandesha2/samples/userguide/AsyncEchoClient.java Mon Apr 23 02:54:53 2007
@@ -0,0 +1,206 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package sandesha2.samples.userguide;
+
+import java.io.File;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMNamespace;
+import org.apache.axiom.soap.SOAP12Constants;
+import org.apache.axiom.soap.SOAPBody;
+import org.apache.axis2.Constants;
+import org.apache.axis2.addressing.AddressingConstants;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
+import org.apache.axis2.client.async.AsyncResult;
+import org.apache.axis2.client.async.Callback;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
+import org.apache.axis2.context.MessageContextConstants;
+import org.apache.sandesha2.client.SandeshaClientConstants;
+import org.apache.sandesha2.util.SandeshaUtil;
+
+public class AsyncEchoClient {
+	
+	private final static String applicationNamespaceName = "http://tempuri.org/"; 
+	private final static String echoString = "echoString";
+	private final static String Text = "Text";
+	private final static String Sequence = "Sequence";
+	private final static String echoStringResponse = "echoStringResponse";
+	private final static String EchoStringReturn = "EchoStringReturn";
+	
+	private String toIP = "127.0.0.1";
+	
+	private String toPort = "8070";
+	
+	private String transportToPort = "8070";
+	
+	private String toEPR = "http://" + toIP +  ":" + toPort + "/axis2/services/RMSampleService";
+	
+	private String transportToEPR = "http://" + toIP +  ":" + transportToPort + "/axis2/services/RMSampleService";
+	
+	private static String SANDESHA2_HOME = "<SANDESHA2_HOME>"; //Change this to ur path.
+	
+	private static String AXIS2_CLIENT_PATH = SANDESHA2_HOME + File.separator + "target" + File.separator +"repos" + File.separator + "client" + File.separator;   //this will be available after a maven build
+	
+	public static void main(String[] args) throws Exception {
+		
+		
+		String axisClientRepo = null;
+		if (args!=null && args.length>0)
+			axisClientRepo = args[0];
+		
+		if (axisClientRepo!=null && !"".equals(axisClientRepo)) {
+			AXIS2_CLIENT_PATH = axisClientRepo;
+			SANDESHA2_HOME = "";
+		}
+		
+		new AsyncEchoClient ().run();
+	}
+	
+	private void run () throws Exception {
+		
+		if ("<SANDESHA2_HOME>".equals(SANDESHA2_HOME)){
+			System.out.println("ERROR: Please set the directory you unzipped Sandesha2 as the first option.");
+			return;
+		}
+
+		String axis2_xml = AXIS2_CLIENT_PATH + "client_axis2.xml";
+     
+		ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(AXIS2_CLIENT_PATH,axis2_xml);
+
+		ServiceClient serviceClient = new ServiceClient (configContext,null);	
+		
+		Options clientOptions = new Options ();
+		
+		clientOptions.setTo(new EndpointReference (toEPR));
+		
+		
+		String acksTo = serviceClient.getMyEPR(Constants.TRANSPORT_HTTP).getAddress() + "/" + ServiceClient.ANON_OUT_IN_OP;
+		clientOptions.setProperty(SandeshaClientConstants.AcksTo,acksTo);
+		
+		String sequenceKey = SandeshaUtil.getUUID();  //sequence key for thie sequence.
+		clientOptions.setProperty(SandeshaClientConstants.SEQUENCE_KEY,sequenceKey);
+		
+//		clientOptions.setReplyTo(new EndpointReference (AddressingConstants.Final.WSA_ANONYMOUS_URL));
+//		clientOptions.setProperty(MessageContextConstants.CHUNKED,Constants.VALUE_FALSE);   //uncomment this to send messages without chunking.
+//		clientOptions.setProperty(SandeshaClientConstants.RM_SPEC_VERSION,Sandesha2Constants.SPEC_VERSIONS.v1_1);  //uncomment this to send the messages according to the v1_1 spec.
+//		serviceClient.engageModule(new QName ("sandesha2"));
+
+		clientOptions.setProperty(MessageContextConstants.TRANSPORT_URL,transportToEPR);
+		
+		clientOptions.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);   //uncomment this to send messages in SOAP 1.2
+
+		clientOptions.setProperty(AddressingConstants.WS_ADDRESSING_VERSION,AddressingConstants.Submission.WSA_NAMESPACE);
+		clientOptions.setProperty(SandeshaClientConstants.OFFERED_SEQUENCE_ID,SandeshaUtil.getUUID());  //Uncomment this to offer a sequenceID for the incoming sequence.
+		clientOptions.setAction("urn:wsrm:EchoString");
+		
+		//You must set the following two properties in the request-reply case.
+		clientOptions.setTransportInProtocol(Constants.TRANSPORT_HTTP);
+		
+		clientOptions.setUseSeparateListener(true);
+		
+		serviceClient.setOptions(clientOptions);
+
+//		Callback callback1 = new TestCallback ("Callback 1");
+//		serviceClient.sendReceiveNonBlocking (getEchoOMBlock("echo1",sequenceKey),callback1);
+//		
+//		Callback callback2 = new TestCallback ("Callback 2");
+//		serviceClient.sendReceiveNonBlocking(getEchoOMBlock("echo2",sequenceKey),callback2);
+//
+//		Callback callback3 = new TestCallback ("Callback 3");
+//		serviceClient.sendReceiveNonBlocking(getEchoOMBlock("echo3",sequenceKey),callback3);
+//		
+//		Callback callback4 = new TestCallback ("Callback 4");
+//		serviceClient.sendReceiveNonBlocking(getEchoOMBlock("echo4",sequenceKey),callback4);
+
+		clientOptions.setProperty(SandeshaClientConstants.LAST_MESSAGE, "true");
+		Callback callback5 = new TestCallback ("Callback 5");
+		serviceClient.sendReceiveNonBlocking(getEchoOMBlock("echo5",sequenceKey),callback5);
+		
+        while (!callback5.isComplete()) {
+            Thread.sleep(1000);
+        }
+        
+        Thread.sleep(4000);
+        
+        configContext.getListenerManager().stop();
+        serviceClient.cleanup();
+        
+	}
+
+	private static OMElement getEchoOMBlock(String text, String sequenceKey) {
+		OMFactory fac = OMAbstractFactory.getOMFactory();
+		OMNamespace applicationNamespace = fac.createOMNamespace(applicationNamespaceName,"ns1");
+		OMElement echoStringElement = fac.createOMElement(echoString, applicationNamespace);
+		OMElement textElem = fac.createOMElement(Text,applicationNamespace);
+		OMElement sequenceElem = fac.createOMElement(Sequence,applicationNamespace);
+		
+		textElem.setText(text);
+		sequenceElem.setText(sequenceKey);
+		echoStringElement.addChild(textElem);
+		echoStringElement.addChild(sequenceElem);
+		
+		return echoStringElement;
+	}
+
+	public class TestCallback extends Callback {
+
+		String name = null;
+		
+		public TestCallback () {
+			
+		}
+		
+		public TestCallback (String name) {
+			this.name = name;
+		}
+		
+		public void onComplete(AsyncResult result) {
+			//System.out.println("On Complete Called for " + text);
+			SOAPBody body = result.getResponseEnvelope().getBody();
+			
+			OMElement echoStringResponseElem = body.getFirstChildWithName(new QName (applicationNamespaceName,echoStringResponse));
+			if (echoStringResponseElem==null) { 
+				System.out.println("Error: SOAPBody does not have a 'echoStringResponse' child");
+				return;
+			}
+			
+			OMElement echoStringReturnElem = echoStringResponseElem.getFirstChildWithName(new QName (applicationNamespaceName,EchoStringReturn));
+			if (echoStringReturnElem==null) { 
+				System.out.println("Error: 'echoStringResponse' element does not have a 'EchoStringReturn' child");
+				return;
+			}
+			
+			String resultStr = echoStringReturnElem.getText();
+			System.out.println("Callback '" + name +  "' got result:" + resultStr);
+		}
+
+		public void onError (Exception e) {
+			// TODO Auto-generated method stub
+			System.out.println("Error reported for test call back");
+			e.printStackTrace();
+		}
+	}
+
+	
+}

Added: webservices/sandesha/trunk/java/modules/samples/src/sandesha2/samples/userguide/AsyncEchoWithPollingClient.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/samples/src/sandesha2/samples/userguide/AsyncEchoWithPollingClient.java?view=auto&rev=531400
==============================================================================
--- webservices/sandesha/trunk/java/modules/samples/src/sandesha2/samples/userguide/AsyncEchoWithPollingClient.java (added)
+++ webservices/sandesha/trunk/java/modules/samples/src/sandesha2/samples/userguide/AsyncEchoWithPollingClient.java Mon Apr 23 02:54:53 2007
@@ -0,0 +1,199 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package sandesha2.samples.userguide;
+
+import java.io.File;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMNamespace;
+import org.apache.axiom.soap.SOAP12Constants;
+import org.apache.axiom.soap.SOAPBody;
+import org.apache.axis2.Constants;
+import org.apache.axis2.addressing.AddressingConstants;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
+import org.apache.axis2.client.async.AsyncResult;
+import org.apache.axis2.client.async.Callback;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
+import org.apache.axis2.context.MessageContextConstants;
+import org.apache.sandesha2.Sandesha2Constants;
+import org.apache.sandesha2.client.SandeshaClient;
+import org.apache.sandesha2.client.SandeshaClientConstants;
+import org.apache.sandesha2.util.SandeshaUtil;
+
+public class AsyncEchoWithPollingClient {
+	
+	private final static String applicationNamespaceName = "http://tempuri.org/"; 
+	private final static String echoString = "echoString";
+	private final static String Text = "Text";
+	private final static String Sequence = "Sequence";
+	private final static String echoStringResponse = "echoStringResponse";
+	private final static String EchoStringReturn = "EchoStringReturn";
+	
+	private String toIP = "127.0.0.1";
+	
+	private String toPort = "8070";
+	
+	private String transportToPort = "8070";
+	
+	private String toEPR = "http://" + toIP +  ":" + toPort + "/axis2/services/RMSampleService";
+	
+	private String transportToEPR = "http://" + toIP +  ":" + transportToPort + "/axis2/services/RMSampleService";
+	
+	private static String SANDESHA2_HOME = "<SANDESHA2_HOME>"; //Change this to ur path.
+	
+	private static String AXIS2_CLIENT_PATH = SANDESHA2_HOME + File.separator + "target" + File.separator +"repos" + File.separator + "client" + File.separator;   //this will be available after a maven build
+	
+	public static void main(String[] args) throws Exception {
+		
+		
+		String axisClientRepo = null;
+		if (args!=null && args.length>0)
+			axisClientRepo = args[0];
+		
+		if (axisClientRepo!=null && !"".equals(axisClientRepo)) {
+			AXIS2_CLIENT_PATH = axisClientRepo;
+			SANDESHA2_HOME = "";
+		}
+		
+		new AsyncEchoWithPollingClient ().run();
+	}
+	
+	private void run () throws Exception {
+		
+		if ("<SANDESHA2_HOME>".equals(SANDESHA2_HOME)){
+			System.out.println("ERROR: Please set the directory you unzipped Sandesha2 as the first option.");
+			return;
+		}
+
+		String axis2_xml = AXIS2_CLIENT_PATH + "client_axis2.xml";
+     
+		ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(AXIS2_CLIENT_PATH,axis2_xml);
+
+		ServiceClient serviceClient = new ServiceClient (configContext,null);	
+		
+		Options clientOptions = new Options ();
+		
+		clientOptions.setTo(new EndpointReference (toEPR));
+		
+//		String acksTo = serviceClient.getMyEPR(Constants.TRANSPORT_HTTP).getAddress() + "/" + ServiceClient.ANON_OUT_IN_OP;
+//		clientOptions.setProperty(SandeshaClientConstants.AcksTo,acksTo);
+//		clientOptions.setProperty(MessageContextConstants.CHUNKED,Constants.VALUE_FALSE);   //uncomment this to send messages without chunking.
+		
+		String sequenceKey = SandeshaUtil.getUUID();  //sequence key for thie sequence.
+		clientOptions.setProperty(SandeshaClientConstants.SEQUENCE_KEY,sequenceKey);
+		
+		clientOptions.setReplyTo(new EndpointReference (AddressingConstants.Submission.WSA_ANONYMOUS_URL));
+		
+		clientOptions.setProperty(MessageContextConstants.TRANSPORT_URL,transportToEPR);
+		
+		clientOptions.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);   //uncomment this to send messages in SOAP 1.2
+		
+		clientOptions.setProperty(SandeshaClientConstants.RM_SPEC_VERSION,Sandesha2Constants.SPEC_VERSIONS.v1_1);  //uncomment this to send the messages according to the v1_1 spec.
+		
+		clientOptions.setProperty(AddressingConstants.WS_ADDRESSING_VERSION,AddressingConstants.Submission.WSA_NAMESPACE);
+		clientOptions.setProperty(SandeshaClientConstants.OFFERED_SEQUENCE_ID,SandeshaUtil.getUUID());  //Uncomment this to offer a sequenceID for the incoming sequence.
+		clientOptions.setAction("urn:wsrm:EchoString");
+		
+		//You must set the following two properties in the request-reply case.
+		clientOptions.setTransportInProtocol(Constants.TRANSPORT_HTTP);
+
+		//This asks Axis2 not to start a listner.
+		clientOptions.setUseSeparateListener(true);
+		
+		serviceClient.setOptions(clientOptions);
+
+		Callback callback1 = new TestCallback ("Callback 1");
+		serviceClient.sendReceiveNonBlocking(getEchoOMBlock("echo1",sequenceKey),callback1);
+		
+		Callback callback2 = new TestCallback ("Callback 2");
+		serviceClient.sendReceiveNonBlocking(getEchoOMBlock("echo1",sequenceKey),callback2);
+		
+		Callback callback3 = new TestCallback ("Callback 3");
+		serviceClient.sendReceiveNonBlocking(getEchoOMBlock("echo1",sequenceKey),callback3);
+		
+        while (!callback3.isComplete()) {
+            Thread.sleep(1000);
+        }
+        
+        Thread.sleep(4000);
+        
+        SandeshaClient.terminateSequence(serviceClient);
+        
+	}
+
+	private static OMElement getEchoOMBlock(String text, String sequenceKey) {
+		OMFactory fac = OMAbstractFactory.getOMFactory();
+		OMNamespace applicationNamespace = fac.createOMNamespace(applicationNamespaceName,"ns1");
+		OMElement echoStringElement = fac.createOMElement(echoString, applicationNamespace);
+		OMElement textElem = fac.createOMElement(Text,applicationNamespace);
+		OMElement sequenceElem = fac.createOMElement(Sequence,applicationNamespace);
+		
+		textElem.setText(text);
+		sequenceElem.setText(sequenceKey);
+		echoStringElement.addChild(textElem);
+		echoStringElement.addChild(sequenceElem);
+		
+		return echoStringElement;
+	}
+
+	public class TestCallback extends Callback {
+
+		String name = null;
+		
+		public TestCallback () {
+			
+		}
+		
+		public TestCallback (String name) {
+			this.name = name;
+		}
+		
+		public void onComplete(AsyncResult result) {
+			//System.out.println("On Complete Called for " + text);
+			SOAPBody body = result.getResponseEnvelope().getBody();
+			
+			OMElement echoStringResponseElem = body.getFirstChildWithName(new QName (applicationNamespaceName,echoStringResponse));
+			if (echoStringResponseElem==null) { 
+				System.out.println("Error: SOAPBody does not have a 'echoStringResponse' child");
+				return;
+			}
+			
+			OMElement echoStringReturnElem = echoStringResponseElem.getFirstChildWithName(new QName (applicationNamespaceName,EchoStringReturn));
+			if (echoStringReturnElem==null) { 
+				System.out.println("Error: 'echoStringResponse' element does not have a 'EchoStringReturn' child");
+				return;
+			}
+			
+			String resultStr = echoStringReturnElem.getText();
+			System.out.println("Callback '" + name +  "' got result:" + resultStr);
+		}
+
+		public void onError (Exception e) {
+			System.out.println("Error reported for test call back");
+			e.printStackTrace();
+		}
+	}
+
+	
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: sandesha-dev-help@ws.apache.org