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 ch...@apache.org on 2006/10/31 10:01:31 UTC

svn commit: r469421 - in /webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2: client/ handlers/ i18n/ msgprocessors/ util/ wsrm/

Author: chamikara
Date: Tue Oct 31 01:01:30 2006
New Revision: 469421

URL: http://svn.apache.org/viewvc?view=rev&rev=469421
Log:
Updated the SandeshaClient. createSequence method was changed to return the generated 
SequenceKey. Users can use this to work with this new sequence.
Also did some corrections to other API functions.
AckRequested.toOM() method was corrected to drop any ackRequest element for the same sequence.

Modified:
    webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/client/SandeshaClient.java
    webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/handlers/SandeshaOutHandler.java
    webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/i18n/SandeshaMessageKeys.java
    webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/i18n/resource.properties
    webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/msgprocessors/AckRequestedProcessor.java
    webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/msgprocessors/ApplicationMsgProcessor.java
    webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/msgprocessors/CloseSequenceProcessor.java
    webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/msgprocessors/CreateSeqMsgProcessor.java
    webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/msgprocessors/TerminateSeqMsgProcessor.java
    webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/util/SpecSpecificConstants.java
    webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/wsrm/AckRequested.java
    webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/wsrm/AcksTo.java

Modified: webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/client/SandeshaClient.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/client/SandeshaClient.java?view=diff&rev=469421&r1=469420&r2=469421
==============================================================================
--- webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/client/SandeshaClient.java (original)
+++ webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/client/SandeshaClient.java Tue Oct 31 01:01:30 2006
@@ -29,6 +29,7 @@
 import org.apache.axiom.soap.impl.llom.soap11.SOAP11Factory;
 import org.apache.axiom.soap.impl.llom.soap12.SOAP12Factory;
 import org.apache.axis2.AxisFault;
+import org.apache.axis2.addressing.AddressingConstants;
 import org.apache.axis2.addressing.EndpointReference;
 import org.apache.axis2.client.Options;
 import org.apache.axis2.client.ServiceClient;
@@ -40,12 +41,14 @@
 import org.apache.axis2.description.AxisOperationFactory;
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.wsdl.WSDLConstants.WSDL20_2004Constants;
+import org.apache.axis2.wsdl.WSDLConstants.WSDL20_2006Constants;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.sandesha2.Sandesha2Constants;
 import org.apache.sandesha2.SandeshaException;
 import org.apache.sandesha2.i18n.SandeshaMessageHelper;
 import org.apache.sandesha2.i18n.SandeshaMessageKeys;
+import org.apache.sandesha2.msgprocessors.ApplicationMsgProcessor;
 import org.apache.sandesha2.storage.StorageManager;
 import org.apache.sandesha2.storage.Transaction;
 import org.apache.sandesha2.storage.beanmanagers.CreateSeqBeanMgr;
@@ -58,7 +61,9 @@
 import org.apache.sandesha2.util.SandeshaUtil;
 import org.apache.sandesha2.util.SpecSpecificConstants;
 import org.apache.sandesha2.wsrm.AckRequested;
+import org.apache.sandesha2.wsrm.AcksTo;
 import org.apache.sandesha2.wsrm.CloseSequence;
+import org.apache.sandesha2.wsrm.CreateSequence;
 import org.apache.sandesha2.wsrm.Identifier;
 import org.apache.sandesha2.wsrm.TerminateSequence;
 
@@ -307,9 +312,17 @@
 		return sandeshaReport;
 	}
 
-	public static void createSequence(ServiceClient serviceClient, boolean offer) throws SandeshaException {
+	/**
+	 * Clients can use this to create a sequence sequence.
+	 * 
+	 * @param serviceClient - A configured ServiceClient to be used to invoke RM messages. This need to have Sandesha2 engaged.
+	 * @param offer - Weather a sequence should be offered for obtaining response messages.
+	 * @return The sequenceKey of the newly generated sequence.
+	 * @throws SandeshaException
+	 */
+	public static String createSequence(ServiceClient serviceClient, boolean offer) throws SandeshaException {
 		
-		setUpServiceClientAnonymousOperation(serviceClient);
+		setUpServiceClientAnonymousOperations (serviceClient);
 		
 		Options options = serviceClient.getOptions();
 		if (options == null)
@@ -326,6 +339,8 @@
 			throw new SandeshaException(SandeshaMessageHelper.getMessage(
 					SandeshaMessageKeys.toEPRNotValid, null));
 
+		ConfigurationContext configurationContext = serviceClient.getServiceContext().getConfigurationContext();
+		
 		if (offer) {
 			String offeredSequenceID = SandeshaUtil.getUUID();
 			options.setProperty(SandeshaClientConstants.OFFERED_SEQUENCE_ID, offeredSequenceID);
@@ -338,16 +353,35 @@
 			options.setProperty(SandeshaClientConstants.SEQUENCE_KEY, sequenceKey);
 		}
 
+		String rmSpecVersion = (String) options.getProperty(SandeshaClientConstants.RM_SPEC_VERSION);
+
+		if (rmSpecVersion == null)
+			rmSpecVersion = SpecSpecificConstants.getDefaultSpecVersion();
+
+		String rmNamespaceValue = SpecSpecificConstants.getRMNamespaceValue(rmSpecVersion);
+		
+		//When the message is marked as Dummy the application processor will not actually try to send it. 
+		//But still the create Sequence will be added.
+
 		options.setProperty(SandeshaClientConstants.DUMMY_MESSAGE, Sandesha2Constants.VALUE_TRUE);
 
-		try {
-			serviceClient.fireAndForget(null);
+		String oldAction = options.getAction();
+		options.setAction(SpecSpecificConstants.getCreateSequenceAction(rmSpecVersion));
+		
+		try {			
+			//just to inform the sender.
+			serviceClient.fireAndForget (null);
 		} catch (AxisFault e) {
 			throw new SandeshaException(e);
 		}
 
+		options.setAction(oldAction);
+		
 		options.setProperty(SandeshaClientConstants.DUMMY_MESSAGE, Sandesha2Constants.VALUE_FALSE);
-
+		
+		//the generated sequenceKey will be returned. Client can use this to work with this newly generated sequence.
+		
+		return sequenceKey;
 	}
 
 	public static void createSequence(ServiceClient serviceClient, boolean offer, String sequenceKey)
@@ -384,7 +418,7 @@
 	 */
 	public static void terminateSequence(ServiceClient serviceClient) throws SandeshaException {
 		
-		setUpServiceClientAnonymousOperation(serviceClient);
+		setUpServiceClientAnonymousOperations (serviceClient);
 		
 		ServiceContext serviceContext = serviceClient.getServiceContext();
 		if (serviceContext == null)
@@ -411,7 +445,8 @@
 		options.setAction(SpecSpecificConstants.getTerminateSequenceAction(rmSpecVersion));
 
 		try {
-			serviceClient.fireAndForget(terminateBody);
+			//to inform the Sandesha2 out handler.
+			serviceClient.fireAndForget (terminateBody);				
 		} catch (AxisFault e) {
 			String message = SandeshaMessageHelper.getMessage(
 					SandeshaMessageKeys.couldNotSendTerminate,
@@ -443,7 +478,7 @@
 	 */
 	public static void closeSequence(ServiceClient serviceClient) throws SandeshaException {
 		
-		setUpServiceClientAnonymousOperation(serviceClient);
+		setUpServiceClientAnonymousOperations (serviceClient);
 		
 		ServiceContext serviceContext = serviceClient.getServiceContext();
 		if (serviceContext == null)
@@ -469,7 +504,8 @@
 		String oldAction = options.getAction();
 		options.setAction(SpecSpecificConstants.getCloseSequenceAction(rmSpecVersion));
 		try {
-			serviceClient.fireAndForget(closeSequenceBody);
+			//to inform the sandesha2 out handler
+			serviceClient.fireAndForget (closeSequenceBody);
 		} catch (AxisFault e) {
 			String message = SandeshaMessageHelper.getMessage(
 					SandeshaMessageKeys.couldNotSendClose,
@@ -481,7 +517,6 @@
 	}
 
 	public static void closeSequence(ServiceClient serviceClient, String sequenceKey) throws SandeshaException {
-		// TODO test
 
 		Options options = serviceClient.getOptions();
 		if (options == null)
@@ -628,7 +663,7 @@
 
 	public static void sendAckRequest(ServiceClient serviceClient) throws SandeshaException {
 
-		setUpServiceClientAnonymousOperation(serviceClient);
+		setUpServiceClientAnonymousOperations (serviceClient);
 		
 		Options options = serviceClient.getOptions();
 		if (options == null)
@@ -702,7 +737,8 @@
 		serviceClient.addHeader(ackRequestedHeaderBlock);
 
 		try {
-			serviceClient.fireAndForget(null);
+			//to inform the sandesha2 out handler
+			serviceClient.fireAndForget (null);
 		} catch (AxisFault e) {
 			String message = SandeshaMessageHelper.getMessage(
 					SandeshaMessageKeys.cannotSendAckRequestException, e.toString());
@@ -1084,27 +1120,107 @@
 		return dummyEnvelope;
 	}
 	
-	private static void setUpServiceClientAnonymousOperation (ServiceClient serviceClient) throws SandeshaException {
+	
+//	private static SOAPEnvelope configureCreateSequence(Options options,
+//			ConfigurationContext configurationContext) throws AxisFault {
+//
+//		if (options == null)
+//			throw new SandeshaException(SandeshaMessageHelper
+//					.getMessage(SandeshaMessageKeys.optionsObjectNotSet));
+//
+//		EndpointReference epr = options.getTo();
+//		if (epr == null)
+//			throw new SandeshaException(SandeshaMessageHelper.getMessage(
+//					SandeshaMessageKeys.toEPRNotValid, null));
+//
+//
+//		String rmSpecVersion = (String) options
+//				.getProperty(SandeshaClientConstants.RM_SPEC_VERSION);
+//		if (rmSpecVersion == null)
+//			rmSpecVersion = SpecSpecificConstants.getDefaultSpecVersion();
+//
+//		options.setAction(SpecSpecificConstants
+//				.getCreateSequenceAction (rmSpecVersion));
+//
+//		SOAPEnvelope dummyEnvelope = null;
+//		SOAPFactory factory = null;
+//		String soapNamespaceURI = options.getSoapVersionURI();
+//		if (SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI
+//				.equals(soapNamespaceURI)) {
+//			factory = new SOAP12Factory();
+//			dummyEnvelope = factory.getDefaultEnvelope();
+//		} else {
+//			factory = new SOAP11Factory();
+//			dummyEnvelope = factory.getDefaultEnvelope();
+//		}
+//
+//		String rmNamespaceValue = SpecSpecificConstants.getRMNamespaceValue(rmSpecVersion);
+//
+//		String addressingNamespaceValue = (String) options.getProperty(AddressingConstants.WS_ADDRESSING_VERSION);
+//		if (addressingNamespaceValue==null)
+//			addressingNamespaceValue = SpecSpecificConstants.getDefaultAddressingNamespace ();
+//		
+//
+//		CreateSequence createSequence = new CreateSequence (rmNamespaceValue,addressingNamespaceValue);
+//		AcksTo acksTo = new AcksTo (rmNamespaceValue,addressingNamespaceValue);
+//		createSequence.setAcksTo(acksTo);
+//		EndpointReference endpointReference = new EndpointReference (null);
+//		acksTo.setAddress(endpointReference);
+//		
+//		createSequence.toSOAPEnvelope(dummyEnvelope);
+//
+//		return dummyEnvelope;
+//	}
+	
+	
+	/**
+	 * Sandesha uses default 'fireAndForget' and 'sendReceive' methods to send control messages.
+	 * But these can only be called when Anonymous operations are present within the passed ServiceClient.
+	 * But these could be situations where these Anonymous operations are not present. In such cases Sandesha2
+	 * will try to add them into the serviceClient. 
+	 */
+	private static void setUpServiceClientAnonymousOperations (ServiceClient serviceClient) throws SandeshaException {
 		try {
+			
 			AxisService service = serviceClient.getAxisService();
+
 			AxisOperation anonOutOnlyOperation = service.getOperation(ServiceClient.ANON_OUT_ONLY_OP);
 			
 			if (anonOutOnlyOperation==null) {
 				anonOutOnlyOperation = AxisOperationFactory.getAxisOperation(WSDL20_2004Constants.MEP_CONSTANT_OUT_ONLY);
 				anonOutOnlyOperation.setName(ServiceClient.ANON_OUT_ONLY_OP);
-				anonOutOnlyOperation.setParent(service);
-				service.addChild(anonOutOnlyOperation);
 				
-				Iterator iter = service.getOperations();
-				AxisOperation referenceOperation = null;
-				if (iter.hasNext())
-					referenceOperation = (AxisOperation) iter.next();
+				AxisOperation referenceOperation = service.getOperation(new QName (Sandesha2Constants.RM_IN_ONLY_OPERATION));
 				
 				if (referenceOperation!=null) {
 					anonOutOnlyOperation.setPhasesOutFlow(referenceOperation.getPhasesOutFlow());
 					anonOutOnlyOperation.setPhasesOutFaultFlow(referenceOperation.getPhasesOutFaultFlow());
 					anonOutOnlyOperation.setPhasesInFaultFlow(referenceOperation.getPhasesInFaultFlow());
 					anonOutOnlyOperation.setPhasesInFaultFlow(referenceOperation.getRemainingPhasesInFlow());
+
+					service.addOperation(anonOutOnlyOperation);
+				} else {
+					String message = "Cant find RM Operations. Please engage the Sandesha2 module before doing the invocation.";
+					throw new SandeshaException (message);
+				}
+			}
+
+			AxisOperation anonOutInOperation = service.getOperation(ServiceClient.ANON_OUT_IN_OP);
+			
+			if (anonOutInOperation==null) {
+				anonOutInOperation = AxisOperationFactory.getAxisOperation(WSDL20_2004Constants.MEP_CONSTANT_OUT_IN);
+				anonOutInOperation.setName(ServiceClient.ANON_OUT_IN_OP);
+				
+				AxisOperation referenceOperation = service.getOperation(new QName (Sandesha2Constants.RM_IN_OUT_OPERATION_NAME));
+				
+				if (referenceOperation!=null) {
+					anonOutInOperation.setPhasesOutFlow(referenceOperation.getPhasesOutFlow());
+					anonOutInOperation.setPhasesOutFaultFlow(referenceOperation.getPhasesOutFaultFlow());
+					anonOutInOperation.setPhasesInFaultFlow(referenceOperation.getPhasesInFaultFlow());
+					anonOutInOperation.setPhasesInFaultFlow(referenceOperation.getRemainingPhasesInFlow());
+					
+					//operation will be added to the service only if a valid referenceOperation was found.
+					service.addOperation(anonOutInOperation);
 				}
 			}
 		} catch (AxisFault e) {

Modified: webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/handlers/SandeshaOutHandler.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/handlers/SandeshaOutHandler.java?view=diff&rev=469421&r1=469420&r2=469421
==============================================================================
--- webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/handlers/SandeshaOutHandler.java (original)
+++ webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/handlers/SandeshaOutHandler.java Tue Oct 31 01:01:30 2006
@@ -31,6 +31,7 @@
 import org.apache.sandesha2.client.SandeshaClientConstants;
 import org.apache.sandesha2.i18n.SandeshaMessageHelper;
 import org.apache.sandesha2.i18n.SandeshaMessageKeys;
+import org.apache.sandesha2.msgprocessors.AckRequestedProcessor;
 import org.apache.sandesha2.msgprocessors.ApplicationMsgProcessor;
 import org.apache.sandesha2.msgprocessors.MsgProcessor;
 import org.apache.sandesha2.msgprocessors.MsgProcessorFactory;
@@ -153,8 +154,13 @@
 					//the msg was paused
 					returnValue = InvocationResponse.SUSPEND;
 				}
+			} else if (messageType==Sandesha2Constants.MessageTypes.ACK_REQUEST) {
+				AckRequestedProcessor ackRequestedProcessor = new AckRequestedProcessor ();
+				if(ackRequestedProcessor.processOutgoingAckRequestMessage (rmMsgCtx)){
+					//the msg was paused
+					returnValue = InvocationResponse.SUSPEND;
+				}
 			}
-				
 
 		} catch (Exception e) {
 			// message should not be sent in a exception situation.

Modified: webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/i18n/SandeshaMessageKeys.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/i18n/SandeshaMessageKeys.java?view=diff&rev=469421&r1=469420&r2=469421
==============================================================================
--- webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/i18n/SandeshaMessageKeys.java (original)
+++ webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/i18n/SandeshaMessageKeys.java Tue Oct 31 01:01:30 2006
@@ -92,7 +92,10 @@
 	public static final String couldNotSendClose="couldNotSendClose";
 	public static final String couldNotSendAck="couldNotSendAck";
 	public static final String couldNotSendTerminateResponse="couldNotSendTerminateResponse";
+	public static final String couldNotSendCloseResponse="couldNotSendCloseResponse";
+	public static final String couldNotSendAckRequestSeqNotFound="couldNotSendAckRequestSeqNotFound";
 	public static final String couldNotSendTerminateSeqNotFound="couldNotSendTerminateSeqNotFound";
+	public static final String couldNotSendCloseSeqNotFound="couldNotSendCloseSeqNotFound";
 	public static final String couldNotSendFault="couldNotSendFault";
 	public static final String cannotSendAckRequestNotActive="cannotSendAckRequestNotActive";
 	public static final String cannotSendAckRequestException="cannotSendAckRequestException";

Modified: webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/i18n/resource.properties
URL: http://svn.apache.org/viewvc/webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/i18n/resource.properties?view=diff&rev=469421&r1=469420&r2=469421
==============================================================================
--- webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/i18n/resource.properties (original)
+++ webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/i18n/resource.properties Tue Oct 31 01:01:30 2006
@@ -112,8 +112,11 @@
 couldNotSendTerminate=Could not send the terminate message due to error {0}.
 couldNotSendClose=Could not send the close sequence message due to error {0}.
 couldNotSendAck=Could not send the ack message on sequence {0} due to an exception: {1}
-couldNotSendTerminateResponse=Could not send the terminate sequence response due to exception {0}.
-couldNotSendTerminateSeqNotFound=Internal sequenceID {0} was not found: cannot send the terminate message.
+couldNotSendTerminateResponse=Could not send the TerminateSequenceResponse due to exception {0}.
+couldNotSendCloseResponse=Could not send the CloseSequenceResponse due to exception {0}.
+couldNotSendTerminateSeqNotFound=Internal sequenceID {0} was not found: cannot send the TerminateSequence message.
+couldNotSendCloseSeqNotFound=Internal sequenceID {0} was not found: cannot send the CloseSequence message.
+couldNotSendAckRequestSeqNotFound=Internal sequenceID {0} was not found: cannot send the AckRequest message.
 couldNotSendFault=Could not send the fault message due to an exception: {0}
 cannotSendAckRequestNotActive=Cannot send the ackRequest message since the sequence with internal ID {0} is not active.
 cannotSendAckRequestException=Could not send the ackRequest message on sequence {0} due to an exception: {1}
@@ -225,7 +228,7 @@
 noFaultCode=Cannot add ''Fault Code'' since the the value is not set correctly.
 seqAckNonHeader=Cannot get sequence acknowlegement from a non-header element
 
-cannotSetACksTo=Cannot set the of the AcksTo element address as the value is not valid {0}
+cannotSetAcksTo=Cannot set the of the AcksTo element address as the {0} value is not valid
 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

Modified: webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/msgprocessors/AckRequestedProcessor.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/msgprocessors/AckRequestedProcessor.java?view=diff&rev=469421&r1=469420&r2=469421
==============================================================================
--- webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/msgprocessors/AckRequestedProcessor.java (original)
+++ webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/msgprocessors/AckRequestedProcessor.java Tue Oct 31 01:01:30 2006
@@ -31,11 +31,15 @@
 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.context.ConfigurationContext;
 import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.context.MessageContextConstants;
 import org.apache.axis2.context.OperationContext;
+import org.apache.axis2.context.OperationContextFactory;
 import org.apache.axis2.description.AxisOperation;
 import org.apache.axis2.description.AxisOperationFactory;
+import org.apache.axis2.description.OutInAxisOperation;
 import org.apache.axis2.engine.AxisEngine;
 import org.apache.axis2.wsdl.WSDLConstants.WSDL20_2004Constants;
 import org.apache.commons.logging.Log;
@@ -43,6 +47,7 @@
 import org.apache.sandesha2.RMMsgContext;
 import org.apache.sandesha2.Sandesha2Constants;
 import org.apache.sandesha2.SandeshaException;
+import org.apache.sandesha2.client.SandeshaClientConstants;
 import org.apache.sandesha2.i18n.SandeshaMessageHelper;
 import org.apache.sandesha2.i18n.SandeshaMessageKeys;
 import org.apache.sandesha2.policy.SandeshaPolicyBean;
@@ -59,6 +64,7 @@
 import org.apache.sandesha2.util.SandeshaUtil;
 import org.apache.sandesha2.util.SpecSpecificConstants;
 import org.apache.sandesha2.wsrm.AckRequested;
+import org.apache.sandesha2.wsrm.TerminateSequence;
 
 /**
  * Responsible for processing ack requested headers on incoming messages.
@@ -308,9 +314,165 @@
 
 			if (log.isDebugEnabled())
 				log.debug("Exit: AckRequestedProcessor::processAckRequestedHeader " + Boolean.TRUE);
+			
 			return true;
 		}
+		
 		return false;
+	}
+	
+	/**
+	 * This is used to capture AckRequest messages send by the SandeshaClient.
+	 * This will send that message using the Sandesha2 Sender.
+	 * 
+	 * @param rmMsgContext
+	 */
+	public boolean processOutgoingAckRequestMessage (RMMsgContext ackRequestRMMsg) throws AxisFault {
+
+		if (log.isDebugEnabled())
+			log.debug("Enter: AckRequestedProcessor::processOutgoingAckRequestMessage");
+
+		MessageContext msgContext = ackRequestRMMsg.getMessageContext();
+		ConfigurationContext configurationContext = msgContext.getConfigurationContext();
+		Options options = msgContext.getOptions();
+
+		StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(configurationContext,
+				configurationContext.getAxisConfiguration());
+
+		SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropertyBeanMgr();
+
+		String toAddress = ackRequestRMMsg.getTo().getAddress();
+		String sequenceKey = (String) options.getProperty(SandeshaClientConstants.SEQUENCE_KEY);
+		String internalSeqenceID = SandeshaUtil.getInternalSequenceID(toAddress, sequenceKey);
+
+		String outSequenceID = SandeshaUtil.getSequenceProperty(internalSeqenceID,
+				Sandesha2Constants.SequenceProperties.OUT_SEQUENCE_ID, storageManager);
+		if (outSequenceID == null)
+			throw new SandeshaException(SandeshaMessageHelper.getMessage(
+					SandeshaMessageKeys.couldNotSendAckRequestSeqNotFound, internalSeqenceID));
+
+
+		// registring an InOutOperationContext for this.
+		// since the serviceContext.fireAndForget only sets a inOnly One
+		// this does not work when there is a terminateSequnceResponse
+		// TODO do processing of terminateMessagesCorrectly., create a new
+		// message instead of sendign the one given by the serviceClient
+		// TODO important
+
+		AxisOperation outInAxisOp = new OutInAxisOperation(new QName("temp"));
+
+		AxisOperation referenceInOutOperation = msgContext.getAxisService()
+				.getOperation(
+						new QName(Sandesha2Constants.RM_IN_OUT_OPERATION_NAME));
+		if (referenceInOutOperation == null) {
+			String messge = "Cant find the recerence RM InOut operation";
+			throw new SandeshaException(messge);
+		}
+
+		outInAxisOp.setParent(msgContext.getAxisService());
+		// setting flows
+		// outInAxisOp.setRemainingPhasesInFlow(referenceInOutOperation.getRemainingPhasesInFlow());
+		outInAxisOp.setRemainingPhasesInFlow(referenceInOutOperation
+				.getRemainingPhasesInFlow());
+
+		OperationContext opcontext = OperationContextFactory
+				.createOperationContext(
+						WSDL20_2004Constants.MEP_CONSTANT_OUT_IN, outInAxisOp);
+		opcontext.setParent(msgContext.getServiceContext());
+		configurationContext.registerOperationContext(ackRequestRMMsg.getMessageId(),
+				opcontext);
+
+		msgContext.setOperationContext(opcontext);
+		msgContext.setAxisOperation(outInAxisOp);
+		
+		Iterator iterator = ackRequestRMMsg.getMessageParts(Sandesha2Constants.MessageParts.ACK_REQUEST);
+		
+		AckRequested ackRequested = null;
+		while (iterator.hasNext()) {
+			ackRequested = (AckRequested) iterator.next(); 
+		}
+		
+		if (iterator.hasNext()) {
+			String message = "Passed message has more than one AckRequest. You can have only one";
+			throw new SandeshaException (message);
+		}
+		
+		if (ackRequested==null) {
+			String message = "No AckRequested part was present in the message";
+			throw new SandeshaException (message);
+		}
+		
+		ackRequested.getIdentifier().setIndentifer(outSequenceID);
+		
+		ackRequestRMMsg.setFlow(MessageContext.OUT_FLOW);
+		msgContext.setProperty(Sandesha2Constants.APPLICATION_PROCESSING_DONE, "true");
+
+		ackRequestRMMsg.setTo(new EndpointReference(toAddress));
+
+		String rmVersion = SandeshaUtil.getRMVersion(internalSeqenceID, storageManager);
+		if (rmVersion == null)
+			throw new SandeshaException(SandeshaMessageHelper.getMessage(SandeshaMessageKeys.cannotDecideRMVersion));
+
+		ackRequestRMMsg.setWSAAction(SpecSpecificConstants.getAckRequestAction (rmVersion));
+		ackRequestRMMsg.setSOAPAction(SpecSpecificConstants.getAckRequestSOAPAction (rmVersion));
+
+		String transportTo = SandeshaUtil.getSequenceProperty(internalSeqenceID,
+				Sandesha2Constants.SequenceProperties.TRANSPORT_TO, storageManager);
+		if (transportTo != null) {
+			ackRequestRMMsg.setProperty(MessageContextConstants.TRANSPORT_URL, transportTo);
+		}
+		
+		
+		//setting msg context properties
+		ackRequestRMMsg.setProperty(Sandesha2Constants.MessageContextProperties.SEQUENCE_ID, outSequenceID);
+		ackRequestRMMsg.setProperty(Sandesha2Constants.MessageContextProperties.INTERNAL_SEQUENCE_ID, internalSeqenceID);
+		ackRequestRMMsg.setProperty(Sandesha2Constants.MessageContextProperties.SEQUENCE_PROPERTY_KEY , sequenceKey);
+
+		try {
+			ackRequestRMMsg.addSOAPEnvelope();
+		} catch (AxisFault e) {
+			throw new SandeshaException(e.getMessage(),e);
+		}
+
+		String key = SandeshaUtil.getUUID();
+
+		SenderBean ackRequestBean = new SenderBean();
+		ackRequestBean.setMessageContextRefKey(key);
+
+		storageManager.storeMessageContext(key, msgContext);
+
+		// Set a retransmitter lastSentTime so that terminate will be send with
+		// some delay.
+		// Otherwise this get send before return of the current request (ack).
+		// TODO: refine the terminate delay.
+		ackRequestBean.setTimeToSend(System.currentTimeMillis());
+
+		ackRequestBean.setMessageID(msgContext.getMessageID());
+		
+		EndpointReference to = msgContext.getTo();
+		if (to!=null)
+			ackRequestBean.setToAddress(to.getAddress());
+		
+		// this will be set to true at the sender.
+		ackRequestBean.setSend(true);
+
+		msgContext.setProperty(Sandesha2Constants.QUALIFIED_FOR_SENDING, Sandesha2Constants.VALUE_FALSE);
+
+		ackRequestBean.setReSend(false);
+
+		SenderBeanMgr retramsmitterMgr = storageManager.getRetransmitterBeanMgr();
+
+		retramsmitterMgr.insert(ackRequestBean);
+
+		ackRequestRMMsg.setProperty(Sandesha2Constants.SET_SEND_TO_TRUE, Sandesha2Constants.VALUE_TRUE);
+
+		SandeshaUtil.executeAndStore(ackRequestRMMsg, key);
+
+		if (log.isDebugEnabled())
+			log.debug("Exit: AckRequestedProcessor::processOutgoingAckRequestMessage " + Boolean.FALSE);
+		
+		return true;
+
 	}
 
 }

Modified: webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/msgprocessors/ApplicationMsgProcessor.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/msgprocessors/ApplicationMsgProcessor.java?view=diff&rev=469421&r1=469420&r2=469421
==============================================================================
--- webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/msgprocessors/ApplicationMsgProcessor.java (original)
+++ webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/msgprocessors/ApplicationMsgProcessor.java Tue Oct 31 01:01:30 2006
@@ -735,44 +735,8 @@
 						Sandesha2Constants.SequenceProperties.OUT_CREATE_SEQUENCE_SENT, "true");
 				seqPropMgr.insert(responseCreateSeqAdded);
 
-				if (serviceContext != null)
-						acksToEPR.setAddress((String) msgContext.getProperty(SandeshaClientConstants.AcksTo));
-
-				if (msgContext.isServerSide()) {
-					// we do not set acksTo value to anonymous when the create
-					// sequence is send from the server.
-					MessageContext requestMessage;
-					try {
-						requestMessage = operationContext
-								.getMessageContext(OperationContextFactory.MESSAGE_LABEL_IN_VALUE);
-					} catch (AxisFault e) {
-						throw new SandeshaException(e);
-					}
-
-					if (requestMessage == null) {
-						String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.requestMsgNotPresent);
-						log.debug(message);
-						throw new SandeshaException(message);
-					}
-					acksToEPR = requestMessage.getTo();
-
-				} else {
-					if (acksToEPR.getAddress() == null){
-						EndpointReference replyToEPR = msgContext.getReplyTo();
-						
-						if(replyToEPR!=null && !replyToEPR.getAddress().equals("")){
-							//use the replyTo address as acksTo
-							if (log.isDebugEnabled())
-								log.debug("Using replyTo " + replyToEPR + " EPR as AcksTo, addr=" + acksToEPR.getAddress());
-							
-							acksToEPR = replyToEPR;
-						}
-						else{
-							acksToEPR.setAddress(anonymousURI);
-						}
-					}
-				}
-
+				acksToEPR = resolveAcksToValue(rmMsgCtx,anonymousURI);
+				
 				if (acksToEPR.getAddress()!=null && !anonymousURI.equals(acksToEPR.getAddress()) && !serverSide) {
 					String transportIn = (String) configContext // TODO verify
 							.getProperty(MessageContext.TRANSPORT_IN);
@@ -876,17 +840,17 @@
 		return true;
 	}
 
-	private void addCreateSequenceMessage(RMMsgContext applicationRMMsg, String sequencePropertyKey, String internalSequenceId, EndpointReference acksTo,
+	public void addCreateSequenceMessage(RMMsgContext referenceRMMsg, String sequencePropertyKey, String internalSequenceId, EndpointReference acksTo,
 			StorageManager storageManager) throws AxisFault {
 
 		if (log.isDebugEnabled())
 			log.debug("Enter: ApplicationMsgProcessor::addCreateSequenceMessage, " + internalSequenceId);
 
-		MessageContext applicationMsg = applicationRMMsg.getMessageContext();
+		MessageContext applicationMsg = referenceRMMsg.getMessageContext();
 		ConfigurationContext configCtx = applicationMsg.getConfigurationContext();
 
 		// generating a new create sequeuce message.
-		RMMsgContext createSeqRMMessage = RMMsgCreator.createCreateSeqMsg(applicationRMMsg, sequencePropertyKey, acksTo,
+		RMMsgContext createSeqRMMessage = RMMsgCreator.createCreateSeqMsg(referenceRMMsg, sequencePropertyKey, acksTo,
 				storageManager);
 
 		createSeqRMMessage.setFlow(MessageContext.OUT_FLOW);
@@ -1233,5 +1197,51 @@
 			return true;
 		
 		return false;
+	}
+	
+	public EndpointReference resolveAcksToValue (RMMsgContext rmMsgCtx, String addressingAnonymousURI) throws SandeshaException {
+
+		EndpointReference acksToEPR = new EndpointReference (null);
+		MessageContext msgCtx = rmMsgCtx.getMessageContext();
+		OperationContext operationContext = msgCtx.getOperationContext();
+		
+		acksToEPR.setAddress((String) msgCtx.getProperty(SandeshaClientConstants.AcksTo));
+
+		if (msgCtx.isServerSide()) {
+			// we do not set acksTo value to anonymous when the create
+			// sequence is send from the server.
+			MessageContext requestMessage;
+			try {
+				requestMessage = operationContext
+						.getMessageContext(OperationContextFactory.MESSAGE_LABEL_IN_VALUE);
+			} catch (AxisFault e) {
+				throw new SandeshaException(e);
+			}
+
+			if (requestMessage == null) {
+				String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.requestMsgNotPresent);
+				log.debug(message);
+				throw new SandeshaException(message);
+			}
+			acksToEPR = requestMessage.getTo();
+
+		} else {
+			if (acksToEPR.getAddress() == null){
+				EndpointReference replyToEPR = msgCtx.getReplyTo();
+				
+				if(replyToEPR!=null && !replyToEPR.getAddress().equals("")){
+					//use the replyTo address as acksTo
+					if (log.isDebugEnabled())
+						log.debug("Using replyTo " + replyToEPR + " EPR as AcksTo, addr=" + acksToEPR.getAddress());
+					
+					acksToEPR = replyToEPR;
+				}
+				else{
+					acksToEPR.setAddress(addressingAnonymousURI);
+				}
+			}
+		}
+		
+		return acksToEPR;
 	}
 }

Modified: webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/msgprocessors/CloseSequenceProcessor.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/msgprocessors/CloseSequenceProcessor.java?view=diff&rev=469421&r1=469420&r2=469421
==============================================================================
--- webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/msgprocessors/CloseSequenceProcessor.java (original)
+++ webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/msgprocessors/CloseSequenceProcessor.java Tue Oct 31 01:01:30 2006
@@ -19,33 +19,49 @@
 
 import java.util.Iterator;
 
+import javax.xml.namespace.QName;
+
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.soap.SOAPEnvelope;
 import org.apache.axiom.soap.SOAPFactory;
 import org.apache.axis2.AxisFault;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.client.Options;
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.context.MessageContextConstants;
+import org.apache.axis2.context.OperationContext;
+import org.apache.axis2.context.OperationContextFactory;
+import org.apache.axis2.description.AxisOperation;
+import org.apache.axis2.description.OutInAxisOperation;
 import org.apache.axis2.engine.AxisEngine;
 import org.apache.axis2.util.Utils;
+import org.apache.axis2.wsdl.WSDLConstants.WSDL20_2004Constants;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.sandesha2.RMMsgContext;
 import org.apache.sandesha2.Sandesha2Constants;
 import org.apache.sandesha2.SandeshaException;
+import org.apache.sandesha2.client.SandeshaClientConstants;
 import org.apache.sandesha2.i18n.SandeshaMessageHelper;
 import org.apache.sandesha2.i18n.SandeshaMessageKeys;
 import org.apache.sandesha2.security.SecurityManager;
 import org.apache.sandesha2.security.SecurityToken;
 import org.apache.sandesha2.storage.StorageManager;
+import org.apache.sandesha2.storage.beanmanagers.SenderBeanMgr;
 import org.apache.sandesha2.storage.beanmanagers.SequencePropertyBeanMgr;
+import org.apache.sandesha2.storage.beans.SenderBean;
 import org.apache.sandesha2.storage.beans.SequencePropertyBean;
 import org.apache.sandesha2.util.AcknowledgementManager;
 import org.apache.sandesha2.util.FaultManager;
 import org.apache.sandesha2.util.RMMsgCreator;
 import org.apache.sandesha2.util.SOAPAbstractFactory;
 import org.apache.sandesha2.util.SandeshaUtil;
+import org.apache.sandesha2.util.SpecSpecificConstants;
 import org.apache.sandesha2.wsrm.CloseSequence;
+import org.apache.sandesha2.wsrm.Identifier;
 import org.apache.sandesha2.wsrm.SequenceAcknowledgement;
+import org.apache.sandesha2.wsrm.TerminateSequence;
 
 /**
  * Responsible for processing an incoming Close Sequence message. (As introduced
@@ -148,7 +164,7 @@
 		try {
 			engine.send(closeSequenceResponseMsg);
 		} catch (AxisFault e) {
-			String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.couldNotSendTerminateResponse,
+			String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.couldNotSendCloseResponse,
 					sequenceId, e.toString());
 			throw new SandeshaException(message, e);
 		}
@@ -158,12 +174,140 @@
 		return false;
 	}
 
-	public boolean processOutMessage(RMMsgContext rmMsgCtx) throws SandeshaException {
+	public boolean processOutMessage(RMMsgContext rmMsgCtx) throws AxisFault {
+		
 		if (log.isDebugEnabled()) {
 			log.debug("Enter: CloseSequenceProcessor::processOutMessage");
 			log.debug("Exit: CloseSequenceProcessor::processOutMessage " + Boolean.FALSE);
 		}
-		return false;
+		
+		MessageContext msgContext = rmMsgCtx.getMessageContext();
+		ConfigurationContext configurationContext = msgContext.getConfigurationContext();
+		Options options = msgContext.getOptions();
+
+		StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(configurationContext,
+				configurationContext.getAxisConfiguration());
+
+		SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropertyBeanMgr();
+
+		String toAddress = rmMsgCtx.getTo().getAddress();
+		String sequenceKey = (String) options.getProperty(SandeshaClientConstants.SEQUENCE_KEY);
+		String internalSeqenceID = SandeshaUtil.getInternalSequenceID(toAddress, sequenceKey);
+
+		String outSequenceID = SandeshaUtil.getSequenceProperty(internalSeqenceID,
+				Sandesha2Constants.SequenceProperties.OUT_SEQUENCE_ID, storageManager);
+		if (outSequenceID == null)
+			throw new SandeshaException(SandeshaMessageHelper.getMessage(
+					SandeshaMessageKeys.couldNotSendCloseSeqNotFound, internalSeqenceID));
+
+
+		// registring an InOutOperationContext for this.
+		// since the serviceContext.fireAndForget only sets a inOnly One
+		// this does not work when there is a closeSequnceResponse
+		// TODO do processing of closeMessagesCorrectly., create a new
+		// message instead of sendign the one given by the serviceClient
+		// TODO important
+
+		AxisOperation outInAxisOp = new OutInAxisOperation(new QName("temp"));
+
+		AxisOperation referenceInOutOperation = msgContext.getAxisService()
+				.getOperation(
+						new QName(Sandesha2Constants.RM_IN_OUT_OPERATION_NAME));
+		if (referenceInOutOperation == null) {
+			String messge = "Cant find the recerence RM InOut operation";
+			throw new SandeshaException(messge);
+		}
+
+		outInAxisOp.setParent(msgContext.getAxisService());
+		// setting flows
+		// outInAxisOp.setRemainingPhasesInFlow(referenceInOutOperation.getRemainingPhasesInFlow());
+		outInAxisOp.setRemainingPhasesInFlow(referenceInOutOperation
+				.getRemainingPhasesInFlow());
+
+		OperationContext opcontext = OperationContextFactory
+				.createOperationContext(
+						WSDL20_2004Constants.MEP_CONSTANT_OUT_IN, outInAxisOp);
+		opcontext.setParent(msgContext.getServiceContext());
+		configurationContext.registerOperationContext(rmMsgCtx.getMessageId(),
+				opcontext);
+
+		msgContext.setOperationContext(opcontext);
+		msgContext.setAxisOperation(outInAxisOp);
+		
+		CloseSequence closeSequencePart = (CloseSequence) rmMsgCtx
+				.getMessagePart(Sandesha2Constants.MessageParts.CLOSE_SEQUENCE);
+		Identifier identifier = closeSequencePart.getIdentifier();
+		if (identifier==null) {
+			identifier = new Identifier (closeSequencePart.getNamespaceValue());
+			closeSequencePart.setIdentifier(identifier);
+		}
+		
+		identifier.setIndentifer(outSequenceID);
+
+		rmMsgCtx.setFlow(MessageContext.OUT_FLOW);
+		msgContext.setProperty(Sandesha2Constants.APPLICATION_PROCESSING_DONE, "true");
+
+		rmMsgCtx.setTo(new EndpointReference(toAddress));
+
+		String rmVersion = SandeshaUtil.getRMVersion(internalSeqenceID, storageManager);
+		if (rmVersion == null)
+			throw new SandeshaException(SandeshaMessageHelper.getMessage(SandeshaMessageKeys.cannotDecideRMVersion));
+
+		rmMsgCtx.setWSAAction(SpecSpecificConstants.getCloseSequenceAction(rmVersion));
+		rmMsgCtx.setSOAPAction(SpecSpecificConstants.getCloseSequenceAction (rmVersion));
+
+		String transportTo = SandeshaUtil.getSequenceProperty(internalSeqenceID,
+				Sandesha2Constants.SequenceProperties.TRANSPORT_TO, storageManager);
+		if (transportTo != null) {
+			rmMsgCtx.setProperty(MessageContextConstants.TRANSPORT_URL, transportTo);
+		}
+		
+		//setting msg context properties
+		rmMsgCtx.setProperty(Sandesha2Constants.MessageContextProperties.SEQUENCE_ID, outSequenceID);
+		rmMsgCtx.setProperty(Sandesha2Constants.MessageContextProperties.INTERNAL_SEQUENCE_ID, internalSeqenceID);
+		rmMsgCtx.setProperty(Sandesha2Constants.MessageContextProperties.SEQUENCE_PROPERTY_KEY , sequenceKey);
+
+		try {
+			rmMsgCtx.addSOAPEnvelope();
+		} catch (AxisFault e) {
+			throw new SandeshaException(e.getMessage(),e);
+		}
+
+		String key = SandeshaUtil.getUUID();
+
+		SenderBean closeBean = new SenderBean();
+		closeBean.setMessageContextRefKey(key);
+
+		storageManager.storeMessageContext(key, msgContext);
+
+		closeBean.setTimeToSend(System.currentTimeMillis());
+
+		closeBean.setMessageID(msgContext.getMessageID());
+		
+		EndpointReference to = msgContext.getTo();
+		if (to!=null)
+			closeBean.setToAddress(to.getAddress());
+		
+		// this will be set to true at the sender.
+		closeBean.setSend(true);
+
+		msgContext.setProperty(Sandesha2Constants.QUALIFIED_FOR_SENDING, Sandesha2Constants.VALUE_FALSE);
+
+		closeBean.setReSend(false);
+
+		SenderBeanMgr retramsmitterMgr = storageManager.getRetransmitterBeanMgr();
+
+		retramsmitterMgr.insert(closeBean);
+
+
+		rmMsgCtx.setProperty(Sandesha2Constants.SET_SEND_TO_TRUE, Sandesha2Constants.VALUE_TRUE);
+
+		SandeshaUtil.executeAndStore(rmMsgCtx, key);
+
+		if (log.isDebugEnabled())
+			log.debug("Exit: CloseSeqMsgProcessor::processOutMessage " + Boolean.TRUE);
+		
+		return true;
 
 	}
 

Modified: webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/msgprocessors/CreateSeqMsgProcessor.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/msgprocessors/CreateSeqMsgProcessor.java?view=diff&rev=469421&r1=469420&r2=469421
==============================================================================
--- webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/msgprocessors/CreateSeqMsgProcessor.java (original)
+++ webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/msgprocessors/CreateSeqMsgProcessor.java Tue Oct 31 01:01:30 2006
@@ -25,11 +25,13 @@
 import org.apache.axiom.om.OMElement;
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.Constants;
+import org.apache.axis2.addressing.AddressingConstants;
 import org.apache.axis2.addressing.EndpointReference;
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.context.OperationContext;
 import org.apache.axis2.engine.AxisEngine;
+import org.apache.axis2.handlers.addressing.AddressingFinalInHandler;
 import org.apache.axis2.util.Utils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -301,10 +303,13 @@
 		return true;
 	}
 
-	public boolean processOutMessage(RMMsgContext rmMsgCtx) throws SandeshaException {
+	public boolean processOutMessage(RMMsgContext rmMsgCtx) throws AxisFault {
+	
 		if (log.isDebugEnabled())
 			log.debug("Enter: CreateSeqMsgProcessor::processOutMessage");
 
+		boolean returnValue = false;
+		
 		MessageContext msgCtx = rmMsgCtx.getMessageContext();
 
 		// adding the SANDESHA_LISTENER
@@ -316,9 +321,12 @@
 				operationContext.setProperty(SandeshaClientConstants.SANDESHA_LISTENER, faultCallback);
 			}
 		}
+						
 		if (log.isDebugEnabled())
-			log.debug("Exit: CreateSeqMsgProcessor::processOutMessage " + Boolean.FALSE);
-		return false;
+			log.debug("Exit: CreateSeqMsgProcessor::processOutMessage " + returnValue);
+	
+		return returnValue;
+
 	}
 	
 }

Modified: webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/msgprocessors/TerminateSeqMsgProcessor.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/msgprocessors/TerminateSeqMsgProcessor.java?view=diff&rev=469421&r1=469420&r2=469421
==============================================================================
--- webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/msgprocessors/TerminateSeqMsgProcessor.java (original)
+++ webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/msgprocessors/TerminateSeqMsgProcessor.java Tue Oct 31 01:01:30 2006
@@ -474,7 +474,8 @@
 
 		if (log.isDebugEnabled())
 			log.debug("Exit: TerminateSeqMsgProcessor::processOutMessage " + Boolean.FALSE);
-		return false;
+		
+		return true;
 	}
 
 }

Modified: webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/util/SpecSpecificConstants.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/util/SpecSpecificConstants.java?view=diff&rev=469421&r1=469420&r2=469421
==============================================================================
--- webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/util/SpecSpecificConstants.java (original)
+++ webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/util/SpecSpecificConstants.java Tue Oct 31 01:01:30 2006
@@ -322,5 +322,9 @@
 		
 		return null;
 	}
+	
+	public static String getDefaultAddressingNamespace () {
+		return AddressingConstants.Final.WSA_NAMESPACE;
+	}
 
 }

Modified: webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/wsrm/AckRequested.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/wsrm/AckRequested.java?view=diff&rev=469421&r1=469420&r2=469421
==============================================================================
--- webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/wsrm/AckRequested.java (original)
+++ webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/wsrm/AckRequested.java Tue Oct 31 01:01:30 2006
@@ -17,6 +17,8 @@
 
 package org.apache.sandesha2.wsrm;
 
+import java.util.Iterator;
+
 import javax.xml.namespace.QName;
 
 import org.apache.axiom.om.OMElement;
@@ -79,6 +81,21 @@
 		OMFactory factory = header.getOMFactory();
 		OMNamespace rmNamespace = factory.createOMNamespace(namespaceValue,Sandesha2Constants.WSRM_COMMON.NS_PREFIX_RM);
 
+		Iterator iter = header.getChildrenWithName(new QName (namespaceValue,Sandesha2Constants.WSRM_COMMON.ACK_REQUESTED));
+		while (iter.hasNext()) {
+			OMElement ackRequestedElement = (OMElement) iter.next();
+			
+			OMElement identifierElement = ackRequestedElement.getFirstChildWithName(new QName (namespaceValue,
+					Sandesha2Constants.WSRM_COMMON.IDENTIFIER));
+			String identifierVal = null;
+			if (identifierElement!=null)
+				identifierVal = identifierElement.getText();
+			
+			if (identifierVal!=null && identifierVal.equals(identifier.getIdentifier()))
+				ackRequestedElement.detach();
+			
+		}
+		
 		SOAPHeader SOAPHdr = (SOAPHeader) header;
 		SOAPHeaderBlock ackReqHdrBlock = SOAPHdr.addHeaderBlock(Sandesha2Constants.WSRM_COMMON.ACK_REQUESTED, rmNamespace);
 		ackReqHdrBlock.setMustUnderstand(isMustUnderstand());

Modified: webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/wsrm/AcksTo.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/wsrm/AcksTo.java?view=diff&rev=469421&r1=469420&r2=469421
==============================================================================
--- webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/wsrm/AcksTo.java (original)
+++ webservices/sandesha/branches/sandesha2/java/1_1/src/org/apache/sandesha2/wsrm/AcksTo.java Tue Oct 31 01:01:30 2006
@@ -80,8 +80,7 @@
 
 		if (epr == null)
 			throw new OMException(SandeshaMessageHelper.getMessage(
-					SandeshaMessageKeys.cannotSetAcksTo,
-					null));
+					SandeshaMessageKeys.cannotSetAcksTo, "EndPointReference"));
 
 		OMFactory factory = element.getOMFactory();
 		



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