ws-sandesha-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mckie...@apache.org
Subject svn commit: r581820 - in /webservices/sandesha/trunk/java/modules: core/src/main/java/org/apache/sandesha2/msgprocessors/ core/src/main/java/org/apache/sandesha2/util/ core/src/main/java/org/apache/sandesha2/wsrm/ tests/src/test/java/org/apache/sandesh...
Date Thu, 04 Oct 2007 09:48:17 GMT
Author: mckierna
Date: Thu Oct  4 02:48:14 2007
New Revision: 581820

URL: http://svn.apache.org/viewvc?rev=581820&view=rev
Log:
Performance improvements

Modified:
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/msgprocessors/AckRequestedProcessor.java
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/msgprocessors/AcknowledgementProcessor.java
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/MsgInitializer.java
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/RangeString.java
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/SandeshaUtil.java
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/AckFinal.java
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/AckNone.java
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/AckRequested.java
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/AcknowledgementRange.java
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/CloseSequence.java
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/CloseSequenceResponse.java
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/CreateSequenceResponse.java
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/Identifier.java
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/LastMessage.java
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/MakeConnection.java
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/MessageNumber.java
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/RMElements.java
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/Sequence.java
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/SequenceAcknowledgement.java
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/SequenceOffer.java
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/TerminateSequence.java
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/TerminateSequenceResponse.java
    webservices/sandesha/trunk/java/modules/tests/src/test/java/org/apache/sandesha2/SandeshaTestCase.java
    webservices/sandesha/trunk/java/modules/tests/src/test/java/org/apache/sandesha2/wsrm/SequenceTest.java

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/msgprocessors/AckRequestedProcessor.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/msgprocessors/AckRequestedProcessor.java?rev=581820&r1=581819&r2=581820&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/msgprocessors/AckRequestedProcessor.java (original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/msgprocessors/AckRequestedProcessor.java Thu Oct  4 02:48:14 2007
@@ -20,12 +20,9 @@
 import java.util.Collection;
 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.axiom.soap.SOAPHeader;
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.addressing.EndpointReference;
 import org.apache.axis2.context.ConfigurationContext;
@@ -71,26 +68,15 @@
 		if (log.isDebugEnabled())
 			log.debug("Enter: AckRequestedProcessor::processAckRequestHeaders");
 
-		SOAPEnvelope envelope = message.getMessageContext().getEnvelope();
-		SOAPHeader header = envelope.getHeader();
 		boolean msgCtxPaused = false;
-		if(header!=null)
-		{
-			for(int i = 0; i < Sandesha2Constants.SPEC_NS_URIS.length; i++) {
-				QName headerName = new QName(Sandesha2Constants.SPEC_NS_URIS[i], Sandesha2Constants.WSRM_COMMON.ACK_REQUESTED);
-				
-				Iterator acks = header.getChildrenWithName(headerName);
-				while(acks.hasNext()) {
-					OMElement ack = (OMElement) acks.next();
-					AckRequested ackReq = new AckRequested(headerName.getNamespaceURI());
-					ackReq.fromOMElement(ack);
-					boolean paused = processAckRequestedHeader(message, ack, ackReq);
-					//if nto already paused we might be now
-					if(!msgCtxPaused){
-						msgCtxPaused = paused;
-					}
-				}
-			}			
+		Iterator ackRequests = message.getMessageParts(Sandesha2Constants.MessageParts.ACK_REQUEST);
+		while(ackRequests.hasNext()){
+			AckRequested ackReq = (AckRequested)ackRequests.next();
+			boolean paused = processAckRequestedHeader(message, ackReq.getOriginalAckRequestedElement(), ackReq);
+			//if not already paused we might be now
+			if(!msgCtxPaused){
+				msgCtxPaused = paused;
+			}
 		}
 
 		if (log.isDebugEnabled())

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/msgprocessors/AcknowledgementProcessor.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/msgprocessors/AcknowledgementProcessor.java?rev=581820&r1=581819&r2=581820&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/msgprocessors/AcknowledgementProcessor.java (original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/msgprocessors/AcknowledgementProcessor.java Thu Oct  4 02:48:14 2007
@@ -19,11 +19,7 @@
 
 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.SOAPHeader;
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.addressing.EndpointReference;
 import org.apache.axis2.context.ConfigurationContext;
@@ -70,23 +66,11 @@
 		if (log.isDebugEnabled())
 			log.debug("Enter: AcknowledgementProcessor::processAckHeaders");
 
-		SOAPEnvelope envelope = message.getMessageContext().getEnvelope();
-		SOAPHeader header = envelope.getHeader();
-		if(header!=null)
-		{
-			for(int i = 0; i < Sandesha2Constants.SPEC_NS_URIS.length; i++) {
-				QName headerName = new QName(Sandesha2Constants.SPEC_NS_URIS[i], Sandesha2Constants.WSRM_COMMON.SEQUENCE_ACK);
-				
-				Iterator acks = header.getChildrenWithName(headerName);
-				while(acks.hasNext()) {
-					OMElement ack = (OMElement) acks.next();
-					SequenceAcknowledgement seqAck = new SequenceAcknowledgement(headerName.getNamespaceURI());
-					seqAck.fromOMElement(ack);
-					processAckHeader(message, ack, seqAck);
-				}
-			}			
+		Iterator iter = message.getMessageParts(Sandesha2Constants.MessageParts.SEQ_ACKNOWLEDGEMENT);
+		while(iter.hasNext()){
+			SequenceAcknowledgement sa = (SequenceAcknowledgement)iter.next();
+			processAckHeader(message, sa.getOriginalSequenceAckElement(), sa);
 		}
-
 
 		if (log.isDebugEnabled())
 			log.debug("Exit: AcknowledgementProcessor::processAckHeaders");

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/MsgInitializer.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/MsgInitializer.java?rev=581820&r1=581819&r2=581820&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/MsgInitializer.java (original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/MsgInitializer.java Thu Oct  4 02:48:14 2007
@@ -63,7 +63,6 @@
 		RMMsgContext rmMsgCtx = new RMMsgContext(ctx);
 
 		populateRMMsgContext(ctx, rmMsgCtx);
-		validateMessage(rmMsgCtx);
 		return rmMsgCtx;
 	}
 
@@ -169,89 +168,68 @@
 
 		if (rmNamespace!=null)
 			rmMsgContext.setRMNamespaceValue(rmNamespace);
+			
+				String sequenceID = null;
 
-	}
-
-	/**
-	 * This is used to validate the message. Also set an Message type. Possible
-	 * types are given in the Sandesha2Constants.MessageTypes interface.
-	 * 
-	 * @param rmMsgCtx
-	 * @return
-	 * @throws SandeshaException
-	 */
-	private static boolean validateMessage(RMMsgContext rmMsgCtx) throws SandeshaException {
-
-		String sequenceID = null;
+		CreateSequence createSequence = elements.getCreateSequence();
+		CreateSequenceResponse createSequenceResponse = elements.getCreateSequenceResponse();
+		TerminateSequence terminateSequence = elements.getTerminateSequence();
+		TerminateSequenceResponse terminateSequenceResponse = elements.getTerminateSequenceResponse();
+		Iterator sequenceAcknowledgementsIter = elements.getSequenceAcknowledgements();
+		Sequence sequence = (Sequence) elements.getSequence();
+		Iterator ackRequestedIter = elements.getAckRequests();
+		CloseSequence closeSequence = elements.getCloseSequence();
+		CloseSequenceResponse closeSequenceResponse = elements.getCloseSequenceResponse();
+		MakeConnection makeConnection = elements.getMakeConnection();
 
-		CreateSequence createSequence = (CreateSequence) rmMsgCtx.getMessagePart(
-				Sandesha2Constants.MessageParts.CREATE_SEQ);
-		CreateSequenceResponse createSequenceResponse = (CreateSequenceResponse) rmMsgCtx.getMessagePart(
-				Sandesha2Constants.MessageParts.CREATE_SEQ_RESPONSE);
-		TerminateSequence terminateSequence = (TerminateSequence) rmMsgCtx.getMessagePart(
-				Sandesha2Constants.MessageParts.TERMINATE_SEQ);
-		TerminateSequenceResponse terminateSequenceResponse = (TerminateSequenceResponse) rmMsgCtx.getMessagePart(
-				Sandesha2Constants.MessageParts.TERMINATE_SEQ_RESPONSE);
-		Iterator sequenceAcknowledgementsIter = rmMsgCtx.getMessageParts(
-				Sandesha2Constants.MessageParts.SEQ_ACKNOWLEDGEMENT);
-		Sequence sequence = (Sequence) rmMsgCtx.getMessagePart(
-				Sandesha2Constants.MessageParts.SEQUENCE);
-		Iterator ackRequestedIter = rmMsgCtx.getMessageParts(
-				Sandesha2Constants.MessageParts.ACK_REQUEST);
-		CloseSequence closeSequence = (CloseSequence) rmMsgCtx.getMessagePart(
-				Sandesha2Constants.MessageParts.CLOSE_SEQUENCE);
-		CloseSequenceResponse closeSequenceResponse = (CloseSequenceResponse) rmMsgCtx.getMessagePart(
-				Sandesha2Constants.MessageParts.CLOSE_SEQUENCE_RESPONSE);
-		MakeConnection makeConnection = (MakeConnection) rmMsgCtx.getMessagePart(
-				Sandesha2Constants.MessageParts.MAKE_CONNECTION);
 
 		// Setting message type.
 		if (createSequence != null) {
-			rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.CREATE_SEQ);
+			rmMsgContext.setMessageType(Sandesha2Constants.MessageTypes.CREATE_SEQ);
 		} else if (createSequenceResponse != null) {
-			rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.CREATE_SEQ_RESPONSE);
+			rmMsgContext.setMessageType(Sandesha2Constants.MessageTypes.CREATE_SEQ_RESPONSE);
 			sequenceID = createSequenceResponse.getIdentifier().getIdentifier();
 		} else if (terminateSequence != null) {
-			rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.TERMINATE_SEQ);
+			rmMsgContext.setMessageType(Sandesha2Constants.MessageTypes.TERMINATE_SEQ);
 			sequenceID = terminateSequence.getIdentifier().getIdentifier();
 		} else if (terminateSequenceResponse != null) {
-			rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.TERMINATE_SEQ_RESPONSE);
+			rmMsgContext.setMessageType(Sandesha2Constants.MessageTypes.TERMINATE_SEQ_RESPONSE);
 			sequenceID = terminateSequenceResponse.getIdentifier().getIdentifier();
-		} else if (rmMsgCtx.getMessagePart(Sandesha2Constants.MessageParts.SEQUENCE) != null) {
+		} else if (sequence != null) {
 			
-			Sequence seq = (Sequence) rmMsgCtx.getMessagePart(Sandesha2Constants.MessageParts.SEQUENCE);
+			Sequence seq = (Sequence) rmMsgContext.getMessagePart(Sandesha2Constants.MessageParts.SEQUENCE);
 			LastMessage lastMessage = seq.getLastMessage();
-			SOAPEnvelope envelope = rmMsgCtx.getSOAPEnvelope();
+			SOAPEnvelope envelope = rmMsgContext.getSOAPEnvelope();
 			
 			if (lastMessage!=null && envelope.getBody().getFirstOMChild()==null) {
 				//the message is an empty body last message
-				rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.LAST_MESSAGE);
+				rmMsgContext.setMessageType(Sandesha2Constants.MessageTypes.LAST_MESSAGE);
 			}else
-				rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.APPLICATION);
+				rmMsgContext.setMessageType(Sandesha2Constants.MessageTypes.APPLICATION);
 			
 			sequenceID = sequence.getIdentifier().getIdentifier();
 		} else if (sequenceAcknowledgementsIter.hasNext()) {
-			rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.ACK);
+			rmMsgContext.setMessageType(Sandesha2Constants.MessageTypes.ACK);
 			SequenceAcknowledgement sequenceAcknowledgement = (SequenceAcknowledgement) sequenceAcknowledgementsIter.next();
 			
 			//if there is only on sequenceAck, sequenceId will be set. Otherwise it will not be.
 			if (!sequenceAcknowledgementsIter.hasNext())
 				sequenceID = sequenceAcknowledgement.getIdentifier().getIdentifier();
 		} else if (ackRequestedIter.hasNext()) {
-			rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.ACK_REQUEST);
+			rmMsgContext.setMessageType(Sandesha2Constants.MessageTypes.ACK_REQUEST);
 			AckRequested ackRequest = (AckRequested) ackRequestedIter.next();
 
 			//if there is only on sequenceAck, sequenceId will be set. Otherwise it will not be.
 			if (!ackRequestedIter.hasNext())
 				sequenceID = ackRequest.getIdentifier().getIdentifier();
 		} else if (closeSequence != null) {
-			rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.CLOSE_SEQUENCE);
+			rmMsgContext.setMessageType(Sandesha2Constants.MessageTypes.CLOSE_SEQUENCE);
 			sequenceID = closeSequence.getIdentifier().getIdentifier();
 		} else if (closeSequenceResponse != null) {
-			rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.CLOSE_SEQUENCE_RESPONSE);
+			rmMsgContext.setMessageType(Sandesha2Constants.MessageTypes.CLOSE_SEQUENCE_RESPONSE);
 			sequenceID = closeSequenceResponse.getIdentifier().getIdentifier(); 
 		} else if (makeConnection != null){
-			rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.MAKE_CONNECTION_MSG);
+			rmMsgContext.setMessageType(Sandesha2Constants.MessageTypes.MAKE_CONNECTION_MSG);
 			if (makeConnection.getIdentifier()!=null) {
 				sequenceID = makeConnection.getIdentifier().getIdentifier();
 			} else if (makeConnection.getAddress()!=null){
@@ -261,12 +239,12 @@
 						"Invalid MakeConnection message. Either Address or Identifier must be present");
 			}
 		} else
-			rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.UNKNOWN);
+			rmMsgContext.setMessageType(Sandesha2Constants.MessageTypes.UNKNOWN);
 		
 		if (sequenceID!=null)
-			rmMsgCtx.setProperty(Sandesha2Constants.MessageContextProperties.SEQUENCE_ID,sequenceID);
+			rmMsgContext.setProperty(Sandesha2Constants.MessageContextProperties.SEQUENCE_ID,sequenceID);
 
-		return true;
 	}
+
 
 }

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/RangeString.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/RangeString.java?rev=581820&r1=581819&r2=581820&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/RangeString.java (original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/RangeString.java Thu Oct  4 02:48:14 2007
@@ -18,13 +18,13 @@
 package org.apache.sandesha2.util;
 
 import java.io.Serializable;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
-import java.util.Map;
 import java.util.Set;
+import java.util.SortedMap;
+import java.util.TreeMap;
+import java.util.Map.Entry;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
@@ -39,11 +39,7 @@
 public class RangeString implements Serializable{
 
 	private static final long serialVersionUID = -3487094584241136861L;
-	/**
-	 * Each entry in this map is a range
-	 * The key to each range entry is range.lowerValue
-	 */
-	private final Map rangeMap;
+	private final SortedMap rangeMap;
 	
 	/**
 	 * Creates an empty range string
@@ -59,7 +55,7 @@
 	 */
 	public RangeString(String s){
 
-		rangeMap = Collections.synchronizedMap(new HashMap());
+		rangeMap = new TreeMap();
 
 		if(s!=null && !s.equals("")){
 			//Walk the string building range objects as we go, and
@@ -85,7 +81,7 @@
 		else{
 			//start at the specified index and work down the list of ranges
 			//utill we find one
-			Iterator iterator = getSortedKeyList().iterator();
+			Iterator iterator = rangeMap.keySet().iterator();
 			
 			while (iterator.hasNext()) {
 				long key = ((Long)iterator.next()).longValue();
@@ -208,15 +204,15 @@
 		return false;
 	}
 	
-	/**
-	 * Returns a String representation of the ranges contained in this object
-	 * @return a String of the form [x1,y1][x2,y2]...[xn,yn]
-	 */
 	public String toString(){
-		List sortedList = getSortedKeyList();
+//		List sortedList = getSortedKeyList();
 		String returnString = "";
-		for(int i=0; i<sortedList.size(); i++){
-			returnString = returnString + (rangeMap.get(sortedList.get(i))).toString();
+//		for(int i=0; i<sortedList.size(); i++){
+//			returnString = returnString + (rangeMap.get(sortedList.get(i))).toString();
+//		}
+		for(Iterator iter = rangeMap.entrySet().iterator();iter.hasNext();){
+			Entry e = (Entry)iter.next();
+			returnString = returnString + e.getValue();
 		}
 		
 		return returnString;
@@ -226,23 +222,16 @@
 	 * @return ordered array of each range object in the string 
 	 */
 	public Range[] getRanges(){
-		List sortedKeyList = getSortedKeyList();
-		Range[] ranges = new Range[sortedKeyList.size()];
-		for(int i=0; i<ranges.length; i++){
-			ranges[i] = (Range)rangeMap.get(sortedKeyList.get(i));
+		Set entrySet = rangeMap.entrySet();
+		Range[] ranges = new Range[entrySet.size()];
+		int i=0;
+		for(Iterator iter = entrySet.iterator();iter.hasNext();){
+			ranges[i] = (Range)((Entry)iter.next()).getValue();
+			i++;
 		}
 		return ranges;
 	}
-	
-	
-	private List getSortedKeyList(){
-		Set keySet = rangeMap.keySet();
-		//sort the set
-		List sortedList = new LinkedList(keySet);
-		Collections.sort(sortedList);
-		return sortedList;
-	}
-	
+		
 	/**
 	 * Returns a List of the form
 	 * [x1,x2,x3....xn] listing each discrete number contained in all of the ranges

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/SandeshaUtil.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/SandeshaUtil.java?rev=581820&r1=581819&r2=581820&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/SandeshaUtil.java (original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/SandeshaUtil.java Thu Oct  4 02:48:14 2007
@@ -25,6 +25,8 @@
 import java.util.Map;
 
 import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
 
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.util.CopyUtils;
@@ -34,6 +36,7 @@
 import org.apache.axiom.soap.SOAPFactory;
 import org.apache.axiom.soap.SOAPHeader;
 import org.apache.axiom.soap.SOAPHeaderBlock;
+import org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder;
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.Constants;
 import org.apache.axis2.addressing.AddressingConstants;
@@ -233,22 +236,31 @@
 	 * @throws SandeshaException
 	 */
 	public static StorageManager getSandeshaStorageManager(ConfigurationContext context,AxisDescription description) throws SandeshaException {
-
-		Parameter parameter = description.getParameter(Sandesha2Constants.STORAGE_MANAGER_PARAMETER);
-		if (parameter==null) {
-			parameter = new Parameter (Sandesha2Constants.STORAGE_MANAGER_PARAMETER,Sandesha2Constants.DEFAULT_STORAGE_MANAGER);
-		}
+		final String STORAGE_MANAGER_INSTANCE = "storageManagerInstance";
+		StorageManager storageManagerInstance = (StorageManager)context.getProperty(STORAGE_MANAGER_INSTANCE);
 		
-		String value = (String) parameter.getValue();
+		if(storageManagerInstance == null){
 		
-		if (Sandesha2Constants.INMEMORY_STORAGE_MANAGER.equals(value))
-			return getInMemoryStorageManager(context);
-		else if (Sandesha2Constants.PERMANENT_STORAGE_MANAGER.equals(value))
-			return getPermanentStorageManager(context);
-		else
-			throw new SandeshaException (SandeshaMessageHelper.getMessage(
-					SandeshaMessageKeys.cannotGetStorageManager));
-	}
+			Parameter parameter = description.getParameter(Sandesha2Constants.STORAGE_MANAGER_PARAMETER);
+			if (parameter==null) {
+				parameter = new Parameter (Sandesha2Constants.STORAGE_MANAGER_PARAMETER,Sandesha2Constants.DEFAULT_STORAGE_MANAGER);
+			}
+			
+			String value = (String) parameter.getValue();
+			
+			if (Sandesha2Constants.INMEMORY_STORAGE_MANAGER.equals(value))
+				storageManagerInstance = getInMemoryStorageManager(context);
+			else if (Sandesha2Constants.PERMANENT_STORAGE_MANAGER.equals(value))
+				storageManagerInstance = getPermanentStorageManager(context);
+			else
+				throw new SandeshaException (SandeshaMessageHelper.getMessage(
+						SandeshaMessageKeys.cannotGetStorageManager));
+			
+			context.setProperty(STORAGE_MANAGER_INSTANCE, storageManagerInstance);
+		}
+		
+		return storageManagerInstance;
+	}	
 	
 	public static StorageManager getInMemoryStorageManager(ConfigurationContext context) throws SandeshaException {
 
@@ -991,6 +1003,75 @@
 		copyConfiguredProperties(oldMsg,newMsg);
 		return newMsg;
 		
+	}
+	
+	public static SOAPEnvelope cloneEnvelope(SOAPEnvelope envelope)
+	        throws SandeshaException
+	{
+
+		// Now clone the env and set it in the message context. We need to be
+		// sure that we
+		// close off the stream reader, in order to free up some of the heap.
+		XMLStreamReader streamReader = null;
+		SOAPEnvelope clonedEnvelope = null;
+		try
+		{
+			streamReader = envelope.getXMLStreamReader();
+			clonedEnvelope = new StAXSOAPModelBuilder(streamReader, null)
+			        .getSOAPEnvelope();
+			// you have to explicitely set the 'processed' attribute for header
+			// blocks, since it get lost in the above read from the stream.
+
+			SOAPHeader header = envelope.getHeader();
+			if (header != null)
+			{
+				Iterator childrenOfOldEnv = header.getChildElements();
+				Iterator childrenOfNewEnv = clonedEnvelope.getHeader()
+				        .getChildElements();
+				while (childrenOfOldEnv.hasNext())
+				{
+					SOAPHeaderBlock oldEnvHeaderBlock = (SOAPHeaderBlock) childrenOfOldEnv
+					        .next();
+					SOAPHeaderBlock newEnvHeaderBlock = (SOAPHeaderBlock) childrenOfNewEnv
+					        .next();
+
+					QName oldEnvHeaderBlockQName = oldEnvHeaderBlock.getQName();
+					if (oldEnvHeaderBlockQName != null)
+					{
+						if (oldEnvHeaderBlockQName.equals(newEnvHeaderBlock
+						        .getQName()))
+						{
+							if (oldEnvHeaderBlock.isProcessed())
+								newEnvHeaderBlock.setProcessed();
+						}
+						else
+						{
+							String message = SandeshaMessageHelper
+							        .getMessage(SandeshaMessageKeys.cloneDoesNotMatchToOriginal);
+							throw new SandeshaException(message);
+						}
+					}
+				}
+			}
+			// Completely build the new tree
+			clonedEnvelope.build();
+		}
+		finally
+		{
+			if (streamReader != null)
+			{
+				try
+				{
+					streamReader.close();
+				}
+				catch (XMLStreamException e)
+				{
+					log.debug("Caught exception closing stream", e);
+				}
+			}
+
+		}
+		return clonedEnvelope;
 	}
 
 	/** 

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/AckFinal.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/AckFinal.java?rev=581820&r1=581819&r2=581820&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/AckFinal.java (original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/AckFinal.java Thu Oct  4 02:48:14 2007
@@ -17,8 +17,6 @@
 
 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;
@@ -48,14 +46,12 @@
 		return namespaceValue;
 	}
 
-	public Object fromOMElement(OMElement element) throws OMException {
+	public Object fromOMElement(OMElement finalPart) throws OMException {
 		
-		OMElement finalPart = element.getFirstChildWithName(new QName(
-				namespaceValue, Sandesha2Constants.WSRM_COMMON.FINAL));
 		if (finalPart == null)
 			throw new OMException(SandeshaMessageHelper.getMessage(
 					SandeshaMessageKeys.noFinalPartInElement,
-					element.toString()));
+					finalPart.toString()));
 
 		return this;
 	}

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/AckNone.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/AckNone.java?rev=581820&r1=581819&r2=581820&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/AckNone.java (original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/AckNone.java Thu Oct  4 02:48:14 2007
@@ -17,8 +17,6 @@
 
 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;
@@ -49,14 +47,11 @@
 		return namespaceValue;
 	}
 
-	public Object fromOMElement(OMElement element) throws OMException {
-	    
-		OMElement nonePart = element.getFirstChildWithName(new QName(
-				namespaceValue, Sandesha2Constants.WSRM_COMMON.NONE));
+	public Object fromOMElement(OMElement nonePart) throws OMException {
 		if (nonePart == null)
 			throw new OMException(SandeshaMessageHelper.getMessage(
 					SandeshaMessageKeys.noNonePartInElement,
-					element.toString()));
+					nonePart.toString()));
 
 		return this;
 	}

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/AckRequested.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/AckRequested.java?rev=581820&r1=581819&r2=581820&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/AckRequested.java (original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/AckRequested.java Thu Oct  4 02:48:14 2007
@@ -47,6 +47,8 @@
 	private String namespaceValue = null;
 	private boolean mustUnderstand = false;
 	
+	private OMElement originalAckRequestedElement;
+	
 	public AckRequested(String namespaceValue) throws SandeshaException {
 		if (!isNamespaceSupported(namespaceValue))
 			throw new SandeshaException (SandeshaMessageHelper.getMessage(
@@ -61,9 +63,13 @@
 	}
 
 	public Object fromOMElement(OMElement ackReqElement) throws OMException,SandeshaException {
-
+		originalAckRequestedElement = ackReqElement;
 		identifier = new Identifier(namespaceValue);
-		identifier.fromOMElement(ackReqElement);
+		OMElement identifierPart = ackReqElement.getFirstChildWithName(new QName(
+				namespaceValue, Sandesha2Constants.WSRM_COMMON.IDENTIFIER));
+		if(identifierPart != null){
+			identifier.fromOMElement(identifierPart);
+		}
 
 		// Indicate that we have processed this SOAPHeaderBlock
 		((SOAPHeaderBlock)ackReqElement).setProcessed();
@@ -145,6 +151,10 @@
 			return true;
 		
 		return false;
+	}
+	
+	public OMElement getOriginalAckRequestedElement() {
+		return originalAckRequestedElement;
 	}
 	
 }

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/AcknowledgementRange.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/AcknowledgementRange.java?rev=581820&r1=581819&r2=581820&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/AcknowledgementRange.java (original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/AcknowledgementRange.java Thu Oct  4 02:48:14 2007
@@ -60,20 +60,20 @@
 			throw new OMException(SandeshaMessageHelper.getMessage(
 					SandeshaMessageKeys.nullPassedElement));
 
-		OMAttribute lowerAttrib = ackRangePart.getAttribute(new QName(
+		String lowerAttribValue = ackRangePart.getAttributeValue(new QName(
 				Sandesha2Constants.WSRM_COMMON.LOWER));
-		OMAttribute upperAttrib = ackRangePart.getAttribute(new QName(
+		String upperAttribValue = ackRangePart.getAttributeValue(new QName(
 				Sandesha2Constants.WSRM_COMMON.UPPER));
 
-		if (lowerAttrib == null || upperAttrib == null)
+		if (lowerAttribValue == null || upperAttribValue == null)
 			throw new OMException(
 					SandeshaMessageHelper.getMessage(
 							SandeshaMessageKeys.noUpperOrLowerAttributesInElement,
 							ackRangePart.toString()));
 
 		try {
-			long lower = Long.parseLong(lowerAttrib.getAttributeValue());
-			long upper = Long.parseLong(upperAttrib.getAttributeValue());
+			long lower = Long.parseLong(lowerAttribValue);
+			long upper = Long.parseLong(upperAttribValue);
 			upperValue = upper;
 			lowerValue = lower;
 		} catch (Exception ex) {
@@ -82,10 +82,9 @@
 							SandeshaMessageKeys.ackRandDoesNotHaveCorrectValues,
 							ackRangePart.toString()));
 		}
-
 		return this;
 	}
-
+	
 	public OMElement toOMElement(OMElement sequenceAckElement)
 			throws OMException {
 

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/CloseSequence.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/CloseSequence.java?rev=581820&r1=581819&r2=581820&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/CloseSequence.java (original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/CloseSequence.java Thu Oct  4 02:48:14 2007
@@ -54,7 +54,6 @@
 	}
 
 	public Object fromOMElement(OMElement body) throws OMException,SandeshaException {
-
 		if (!(body instanceof SOAPBody))
 			throw new OMException(SandeshaMessageHelper.getMessage(
 					SandeshaMessageKeys.closeSeqCannotBeAddedToNonBody));
@@ -68,11 +67,14 @@
 					body.toString()));
 
 		identifier = new Identifier(namespaceValue);
-		identifier.fromOMElement(closeSeqPart);
-
+		OMElement identifierPart = closeSeqPart.getFirstChildWithName(new QName(
+				namespaceValue, Sandesha2Constants.WSRM_COMMON.IDENTIFIER));
+		if(identifierPart != null){
+			identifier.fromOMElement(identifierPart);
+		}
 		return this;
 	}
-
+	
 	public OMElement toOMElement(OMElement body) throws OMException {
 
 		if (body == null || !(body instanceof SOAPBody))

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/CloseSequenceResponse.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/CloseSequenceResponse.java?rev=581820&r1=581819&r2=581820&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/CloseSequenceResponse.java (original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/CloseSequenceResponse.java Thu Oct  4 02:48:14 2007
@@ -53,7 +53,6 @@
 	}
 
 	public Object fromOMElement(OMElement body) throws OMException,SandeshaException {
-
 		if (!(body instanceof SOAPBody))
 			throw new OMException(
 					SandeshaMessageHelper.getMessage(
@@ -68,11 +67,14 @@
 					body.toString()));
 
 		identifier = new Identifier(namespaceValue);
-		identifier.fromOMElement(closeSeqResponsePart);
-
+		OMElement identifierPart = closeSeqResponsePart.getFirstChildWithName(new QName(
+				namespaceValue, Sandesha2Constants.WSRM_COMMON.IDENTIFIER));
+		if(identifierPart != null){
+			identifier.fromOMElement(identifierPart);
+		}
 		return this;
 	}
-
+	
 	public OMElement toOMElement(OMElement body) throws OMException {
 
 		if (body == null || !(body instanceof SOAPBody))

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/CreateSequenceResponse.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/CreateSequenceResponse.java?rev=581820&r1=581819&r2=581820&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/CreateSequenceResponse.java (original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/CreateSequenceResponse.java Thu Oct  4 02:48:14 2007
@@ -74,7 +74,10 @@
 					bodyElement.toString()));
 
 		identifier = new Identifier(rmNamespaceValue);
-		identifier.fromOMElement(createSeqResponsePart);
+		OMElement identifierPart = createSeqResponsePart.getFirstChildWithName(new QName(rmNamespaceValue, Sandesha2Constants.WSRM_COMMON.IDENTIFIER));
+		if(identifierPart != null){
+			identifier.fromOMElement(identifierPart);
+		}
 
 		OMElement expiresPart = createSeqResponsePart.getFirstChildWithName(
 					new QName(rmNamespaceValue,

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/Identifier.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/Identifier.java?rev=581820&r1=581819&r2=581820&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/Identifier.java (original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/Identifier.java Thu Oct  4 02:48:14 2007
@@ -21,8 +21,6 @@
  * Represents an Identifier element.
  */
 
-import javax.xml.namespace.QName;
-
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMException;
 import org.apache.axiom.om.OMFactory;
@@ -55,25 +53,22 @@
 		return identifier;
 	}
 
-	public Object fromOMElement(OMElement element) throws OMException {
-		
-		OMElement identifierPart = element.getFirstChildWithName(new QName(
-				namespaceValue, Sandesha2Constants.WSRM_COMMON.IDENTIFIER));
+	public Object fromOMElement(OMElement identifierPart) throws OMException {
 		if (identifierPart == null)
 			throw new OMException(SandeshaMessageHelper.getMessage(
 					SandeshaMessageKeys.invalidIdentifier,
-					element.toString()));
+					identifierPart.toString()));
 		
 		String identifierText = identifierPart.getText();
 		if (identifierText == null || identifierText == "")
 			throw new OMException(SandeshaMessageHelper.getMessage(
 					SandeshaMessageKeys.invalidIdentifier,
-					element.toString()));
+					identifierPart.toString()));
 
 		identifier = identifierText;
 		return this;
 	}
-
+	
 	public OMElement toOMElement(OMElement element, OMNamespace wsrmNamespace) throws OMException {
 
 		if (identifier == null || identifier == "") {

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/LastMessage.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/LastMessage.java?rev=581820&r1=581819&r2=581820&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/LastMessage.java (original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/LastMessage.java Thu Oct  4 02:48:14 2007
@@ -17,8 +17,6 @@
 
 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;
@@ -49,13 +47,11 @@
 		return namespaceValue;
 	}
 
-	public Object fromOMElement(OMElement element) throws OMException {
-		OMElement lastMessagePart = element.getFirstChildWithName(new QName(
-				namespaceValue, Sandesha2Constants.WSRM_COMMON.LAST_MSG));
+	public Object fromOMElement(OMElement lastMessagePart) throws OMException {
 		if (lastMessagePart == null)
 			throw new OMException(SandeshaMessageHelper.getMessage(
 					SandeshaMessageKeys.noLastMessagePartInElement,
-					element.toString()));
+					lastMessagePart.toString()));
 
 		return this;
 	}

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/MakeConnection.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/MakeConnection.java?rev=581820&r1=581819&r2=581820&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/MakeConnection.java (original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/MakeConnection.java Thu Oct  4 02:48:14 2007
@@ -74,7 +74,7 @@
 		
 		if (identifierElement!=null) {
 			identifier = new Identifier (identifierElement.getNamespace().getNamespaceURI());
-			identifier.fromOMElement(makeConnectionElement);
+			identifier.fromOMElement(identifierElement);
 		}
 		
 		if (addressElement!=null) {

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/MessageNumber.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/MessageNumber.java?rev=581820&r1=581819&r2=581820&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/MessageNumber.java (original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/MessageNumber.java Thu Oct  4 02:48:14 2007
@@ -17,8 +17,6 @@
 
 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;
@@ -54,13 +52,11 @@
 		this.messageNumber = messageNumber;
 	}
 	
-	public Object fromOMElement(OMElement sequenceElement) throws OMException {
-		OMElement msgNumberPart = sequenceElement.getFirstChildWithName( 
-				new QName (namespaceValue,Sandesha2Constants.WSRM_COMMON.MSG_NUMBER));
+	public Object fromOMElement(OMElement msgNumberPart) throws OMException {
 		if (msgNumberPart==null)
 			throw new OMException (SandeshaMessageHelper.getMessage(
 					SandeshaMessageKeys.noMessageNumberPartInElement,
-					sequenceElement.toString()));
+					msgNumberPart.toString()));
 		
 		String msgNoStr = msgNumberPart.getText();
 		messageNumber = Long.parseLong(msgNoStr);

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/RMElements.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/RMElements.java?rev=581820&r1=581819&r2=581820&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/RMElements.java (original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/RMElements.java Thu Oct  4 02:48:14 2007
@@ -24,14 +24,16 @@
 
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMException;
-import org.apache.axiom.soap.SOAP11Constants;
+import org.apache.axiom.soap.SOAPBody;
 import org.apache.axiom.soap.SOAPEnvelope;
 import org.apache.axiom.soap.SOAPFactory;
 import org.apache.axis2.AxisFault;
 import org.apache.sandesha2.Sandesha2Constants;
+import org.apache.sandesha2.Sandesha2Constants.SPEC_2005_02;
+import org.apache.sandesha2.Sandesha2Constants.SPEC_2007_02;
+import org.apache.sandesha2.Sandesha2Constants.WSRM_COMMON;
 import org.apache.sandesha2.i18n.SandeshaMessageHelper;
 import org.apache.sandesha2.i18n.SandeshaMessageKeys;
-import org.apache.sandesha2.util.SOAPAbstractFactory;
 
 /**
  * All RM model classes should implement this.
@@ -73,142 +75,137 @@
 			throw new OMException(SandeshaMessageHelper.getMessage(
 					SandeshaMessageKeys.nullPassedElement));
 
-		SOAPFactory factory;
-
-		//Yep, I know. Could hv done it directly :D (just to make it consistent)
-		if (envelope.getNamespace().getNamespaceURI().equals(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI))
-			factory = SOAPAbstractFactory.getSOAPFactory(Sandesha2Constants.SOAPVersion.v1_1);
-		else
-			factory = SOAPAbstractFactory.getSOAPFactory(Sandesha2Constants.SOAPVersion.v1_2);
-		
 		// Check for RM defined elements, using either spec version
 		OMElement header = envelope.getHeader();
-		OMElement body = envelope.getBody();
+		SOAPBody body = envelope.getBody();
 
-		// The sequence header
-		OMElement element = null;
-		if(header!=null)
-		{
-			element = header.getFirstChildWithName(Sandesha2Constants.SPEC_2007_02.QNames.Sequence);
-			if(element == null) {
-				element = envelope.getHeader().getFirstChildWithName(Sandesha2Constants.SPEC_2005_02.QNames.Sequence);
-			}
-			if (element != null) {
-				sequence = new Sequence(element.getNamespace().getNamespaceURI());
-				sequence.fromOMElement(envelope.getHeader());
-			}			
+		if(header != null){
+			processHeaders(envelope);
 		}
-
-
+		if(body != null){
+			processBody(body);
+		}
+	}
+	
+	private void processBody(SOAPBody body) throws AxisFault{
 		// The body messages
 		OMElement firstBodyElement = body.getFirstElement();
 		if(firstBodyElement != null) {
 			QName firstBodyQName = firstBodyElement.getQName();
-			
-			if(Sandesha2Constants.SPEC_2007_02.QNames.CreateSequence.equals(firstBodyQName)) {
-				createSequence = new CreateSequence(firstBodyQName.getNamespaceURI());
-				createSequence.fromOMElement(body);
-			} else if(Sandesha2Constants.SPEC_2005_02.QNames.CreateSequence.equals(firstBodyQName)) {
-				createSequence = new CreateSequence(firstBodyQName.getNamespaceURI());
-				createSequence.fromOMElement(body);
-
-			} else if(Sandesha2Constants.SPEC_2007_02.QNames.CreateSequenceResponse.equals(firstBodyQName)) {
-				createSequenceResponse = new CreateSequenceResponse(firstBodyQName.getNamespaceURI());
-				createSequenceResponse.fromOMElement(body);
-			} else if(Sandesha2Constants.SPEC_2005_02.QNames.CreateSequenceResponse.equals(firstBodyQName)) {
-				createSequenceResponse = new CreateSequenceResponse(firstBodyQName.getNamespaceURI());
-				createSequenceResponse.fromOMElement(body);
-
-			} else if(Sandesha2Constants.SPEC_2007_02.QNames.CloseSequence.equals(firstBodyQName)) {
-				closeSequence = new CloseSequence(firstBodyQName.getNamespaceURI());
-				closeSequence.fromOMElement(body);
-			} else if(Sandesha2Constants.SPEC_2005_02.QNames.CloseSequence.equals(firstBodyQName)) {
-				closeSequence = new CloseSequence(firstBodyQName.getNamespaceURI());
-				closeSequence.fromOMElement(body);
-
-			} else if(Sandesha2Constants.SPEC_2007_02.QNames.CloseSequenceResponse.equals(firstBodyQName)) {
-				closeSequenceResponse = new CloseSequenceResponse(firstBodyQName.getNamespaceURI());
-				closeSequenceResponse.fromOMElement(body);
-			} else if(Sandesha2Constants.SPEC_2005_02.QNames.CloseSequenceResponse.equals(firstBodyQName)) {
-				closeSequenceResponse = new CloseSequenceResponse(firstBodyQName.getNamespaceURI());
-				closeSequenceResponse.fromOMElement(body);
-
-			} else if(Sandesha2Constants.SPEC_2007_02.QNames.TerminateSequence.equals(firstBodyQName)) {
-				terminateSequence = new TerminateSequence(firstBodyQName.getNamespaceURI());
-				terminateSequence.fromOMElement(body);
-			} else if(Sandesha2Constants.SPEC_2005_02.QNames.TerminateSequence.equals(firstBodyQName)) {
-				terminateSequence = new TerminateSequence(firstBodyQName.getNamespaceURI());
-				terminateSequence.fromOMElement(body);
-
-			} else if(Sandesha2Constants.SPEC_2007_02.QNames.TerminateSequenceResponse.equals(firstBodyQName)) {
-				terminateSequenceResponse = new TerminateSequenceResponse(firstBodyQName.getNamespaceURI());
-				terminateSequenceResponse.fromOMElement(body);
-			} else if(Sandesha2Constants.SPEC_2005_02.QNames.TerminateSequenceResponse.equals(firstBodyQName)) {
-				terminateSequenceResponse = new TerminateSequenceResponse(firstBodyQName.getNamespaceURI());
-				terminateSequenceResponse.fromOMElement(body);
+			String namespace = firstBodyQName.getNamespaceURI();
+			String localName = firstBodyQName.getLocalPart();
 
-			} else if(Sandesha2Constants.SPEC_2007_02.QNames.MakeConnection.equals(firstBodyQName)) {
-				makeConnection = new MakeConnection(firstBodyQName.getNamespaceURI());
+			boolean isSPEC2007_02 = SPEC_2007_02.NS_URI.equals(namespace);
+			boolean isSPEC2005_02 = false;
+			if(!isSPEC2007_02){
+				isSPEC2005_02 = SPEC_2005_02.NS_URI.equals(namespace);
+			}
+
+			if(isSPEC2005_02 || isSPEC2007_02){
+				if(Sandesha2Constants.SPEC_2007_02.QNames.CreateSequence.equals(firstBodyQName)) {
+					createSequence = new CreateSequence(namespace);
+					createSequence.fromOMElement(body);
+				} else if(Sandesha2Constants.SPEC_2005_02.QNames.CreateSequence.equals(firstBodyQName)) {
+					createSequence = new CreateSequence(namespace);
+					createSequence.fromOMElement(body);
+				} else if(Sandesha2Constants.SPEC_2007_02.QNames.CreateSequenceResponse.equals(firstBodyQName)) {
+					createSequenceResponse = new CreateSequenceResponse(namespace);
+					createSequenceResponse.fromOMElement(body);
+				} else if(Sandesha2Constants.SPEC_2005_02.QNames.CreateSequenceResponse.equals(firstBodyQName)) {
+					createSequenceResponse = new CreateSequenceResponse(namespace);
+					createSequenceResponse.fromOMElement(body);
+				} else if(Sandesha2Constants.SPEC_2007_02.QNames.CloseSequence.equals(firstBodyQName)) {
+					closeSequence = new CloseSequence(namespace);
+					closeSequence.fromOMElement(body);
+				} else if(Sandesha2Constants.SPEC_2005_02.QNames.CloseSequence.equals(firstBodyQName)) {
+					closeSequence = new CloseSequence(namespace);
+					closeSequence.fromOMElement(body);
+				} else if(Sandesha2Constants.SPEC_2007_02.QNames.CloseSequenceResponse.equals(firstBodyQName)) {
+					closeSequenceResponse = new CloseSequenceResponse(namespace);
+					closeSequenceResponse.fromOMElement(body);
+				} else if(Sandesha2Constants.SPEC_2005_02.QNames.CloseSequenceResponse.equals(firstBodyQName)) {
+					closeSequenceResponse = new CloseSequenceResponse(namespace);
+					closeSequenceResponse.fromOMElement(body);
+				} else if(Sandesha2Constants.SPEC_2007_02.QNames.TerminateSequence.equals(firstBodyQName)) {
+					terminateSequence = new TerminateSequence(namespace);
+					terminateSequence.fromOMElement(body);
+				} else if(Sandesha2Constants.SPEC_2005_02.QNames.TerminateSequence.equals(firstBodyQName)) {
+					terminateSequence = new TerminateSequence(namespace);
+					terminateSequence.fromOMElement(body);
+				} else if(Sandesha2Constants.SPEC_2007_02.QNames.TerminateSequenceResponse.equals(firstBodyQName)) {
+					terminateSequenceResponse = new TerminateSequenceResponse(namespace);
+					terminateSequenceResponse.fromOMElement(body);
+				} else if(Sandesha2Constants.SPEC_2005_02.QNames.TerminateSequenceResponse.equals(firstBodyQName)) {
+					terminateSequenceResponse = new TerminateSequenceResponse(namespace);
+					terminateSequenceResponse.fromOMElement(body);
+				}
+			}else if(Sandesha2Constants.SPEC_2007_02.QNames.MakeConnection.equals(firstBodyQName)) {
+				makeConnection = new MakeConnection(namespace);
 				makeConnection.fromOMElement(firstBodyElement);
 			}
 		}
-		
-		// The other headers
+	}
+	
+	private void processHeaders(SOAPEnvelope envelope) throws AxisFault {
+
+		if (envelope == null)
+			throw new OMException(SandeshaMessageHelper.getMessage(
+					SandeshaMessageKeys.nullPassedElement));
+
+		SOAPFactory factory = (SOAPFactory)envelope.getOMFactory();
+		OMElement header = envelope.getHeader();
+
 		if(header!=null)
 		{
-			Iterator headers = header.getChildrenWithName(Sandesha2Constants.SPEC_2007_02.QNames.SequenceAck);
-			while (headers.hasNext()) {
-				OMElement sequenceAckElement = (OMElement) headers.next();
-				SequenceAcknowledgement sequenceAcknowledgement = new SequenceAcknowledgement(Sandesha2Constants.SPEC_2007_02.NS_URI);
-				sequenceAcknowledgement.fromOMElement(sequenceAckElement);
-				sequenceAcknowledgements.add(sequenceAcknowledgement);
-			}
-			headers = header.getChildrenWithName(Sandesha2Constants.SPEC_2005_02.QNames.SequenceAck);
-			while (headers.hasNext()) {
-				OMElement sequenceAckElement = (OMElement) headers.next();
-				SequenceAcknowledgement sequenceAcknowledgement = new SequenceAcknowledgement(Sandesha2Constants.SPEC_2005_02.NS_URI);
-				sequenceAcknowledgement.fromOMElement(sequenceAckElement);
-				sequenceAcknowledgements.add(sequenceAcknowledgement);
-			}
-
-			headers = header.getChildrenWithName(Sandesha2Constants.SPEC_2007_02.QNames.AckRequest);
-			while (headers.hasNext()) {
-				OMElement ackRequestElement = (OMElement) headers.next();
-				AckRequested ackRequest = new AckRequested(Sandesha2Constants.SPEC_2007_02.NS_URI);
-				ackRequest.fromOMElement(ackRequestElement);
-				ackRequests.add(ackRequest);
-			}
-			headers = header.getChildrenWithName(Sandesha2Constants.SPEC_2005_02.QNames.AckRequest);
-			while (headers.hasNext()) {
-				OMElement ackRequestElement = (OMElement) headers.next();
-				AckRequested ackRequest = new AckRequested(Sandesha2Constants.SPEC_2005_02.NS_URI);
-				ackRequest.fromOMElement(ackRequestElement);
-				ackRequests.add(ackRequest);
-			}
-			
-			element = header.getFirstChildWithName(Sandesha2Constants.SPEC_2007_02.QNames.UsesSequenceSTR);
-			if (element != null) {
-				usesSequenceSTR = new UsesSequenceSTR(factory, Sandesha2Constants.SPEC_2007_02.NS_URI);
-				usesSequenceSTR.fromOMElement(element);
-			}
-			
-			element = header.getFirstChildWithName(Sandesha2Constants.SPEC_2007_02.QNames.MessagePending);
-			if (element != null) {
-				messagePending = new MessagePending(Sandesha2Constants.SPEC_2007_02.MC_NS_URI);
-				messagePending.fromOMElement(element);
-			}
-			
-			element = header.getFirstChildWithName(Sandesha2Constants.SPEC_2007_02.QNames.SequenceFault);
-			if(element == null) {
-				element = header.getFirstChildWithName(Sandesha2Constants.SPEC_2005_02.QNames.SequenceFault);
-			}
-			if (element !=null) {
-				sequenceFault = new SequenceFault(element.getNamespace().getNamespaceURI());
-				sequenceFault.fromOMElement(element);
+			Iterator headers = header.getChildElements();
+			while(headers.hasNext()){
+				OMElement element = (OMElement)headers.next();
+				QName elementName = element.getQName();
+				String namespace = elementName.getNamespaceURI();
+				String localName = elementName.getLocalPart();
+				
+				boolean isSPEC2007_02 = SPEC_2007_02.NS_URI.equals(namespace);
+				boolean isSPEC2005_02 = false;
+				if(!isSPEC2007_02){
+					isSPEC2005_02 = SPEC_2005_02.NS_URI.equals(namespace);
+				}
+				
+				if(isSPEC2005_02 || isSPEC2007_02){
+					boolean isProcessed = false;
+					if(isSPEC2007_02){
+						if(WSRM_COMMON.USES_SEQUENCE_STR.equals(localName)){
+							usesSequenceSTR = new UsesSequenceSTR(factory, namespace);
+							usesSequenceSTR.fromOMElement(element);
+							isProcessed = true;
+						}else if(WSRM_COMMON.MESSAGE_PENDING.equals(localName)){
+							messagePending = new MessagePending(namespace);
+							messagePending.fromOMElement(element);
+							isProcessed = true;
+						}
+					}
+					
+					if(!isProcessed){
+						if(WSRM_COMMON.SEQUENCE.equals(localName)){
+							sequence = new Sequence(namespace);
+							sequence.fromOMElement(element);
+						}else if(WSRM_COMMON.SEQUENCE_ACK.equals(localName)){
+							SequenceAcknowledgement sequenceAcknowledgement = new SequenceAcknowledgement(namespace);
+							sequenceAcknowledgement.fromOMElement(element);
+							sequenceAcknowledgements.add(sequenceAcknowledgement);
+						}else if(WSRM_COMMON.ACK_REQUESTED.equals(localName)){
+							AckRequested ackRequest = new AckRequested(namespace);
+							ackRequest.fromOMElement(element);
+							ackRequests.add(ackRequest);
+						}else if(WSRM_COMMON.SEQUENCE_FAULT.equals(localName)){
+							sequenceFault = new SequenceFault(namespace);
+							sequenceFault.fromOMElement(element);
+						}	
+					}
+				}
 			}
 		}
 	}
-
+	
 	public SOAPEnvelope toSOAPEnvelope(SOAPEnvelope envelope) throws AxisFault  {
 		if (sequence != null) {
 			sequence.toOMElement(envelope.getHeader());

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/Sequence.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/Sequence.java?rev=581820&r1=581819&r2=581820&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/Sequence.java (original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/Sequence.java Thu Oct  4 02:48:14 2007
@@ -17,6 +17,7 @@
 
 package org.apache.sandesha2.wsrm;
 
+import java.util.Iterator;
 import javax.xml.namespace.QName;
 
 import org.apache.axiom.om.OMElement;
@@ -57,40 +58,48 @@
 		return namespaceValue;
 	}
 
-	public Object fromOMElement(OMElement headerElement) throws OMException,SandeshaException {
+	public Object fromOMElement(OMElement ome) throws OMException,SandeshaException {
+		SOAPHeaderBlock shb = (SOAPHeaderBlock)ome;
 
-		SOAPHeader header = (SOAPHeader) headerElement;
-		if (header == null)
-			throw new OMException(
-					SandeshaMessageHelper.getMessage(
-							SandeshaMessageKeys.seqElementCannotBeAddedToNonHeader));
-
-		OMElement sequencePart = headerElement.getFirstChildWithName(new QName(namespaceValue,
-						Sandesha2Constants.WSRM_COMMON.SEQUENCE));
-		if (sequencePart == null)
+		if (shb == null)
 			throw new OMException(SandeshaMessageHelper.getMessage(
 					SandeshaMessageKeys.noSequencePartInElement,
-					headerElement.toString()));
+					shb.toString()));
+		
+		OMElement identifierPart = null;
+		OMElement msgNumberPart = null;
+		OMElement lastMessageElement = null;
+		
+		Iterator iter = shb.getChildElements();
+		while(iter.hasNext()){
+			OMElement child = (OMElement)iter.next();
+			QName qn = child.getQName();
+			if(namespaceValue.equals(qn.getNamespaceURI())){
+				if(Sandesha2Constants.WSRM_COMMON.IDENTIFIER.equals(qn.getLocalPart())){
+					identifierPart = child;
+				}else if(Sandesha2Constants.WSRM_COMMON.MSG_NUMBER.equals(qn.getLocalPart())){
+					msgNumberPart = child;
+				}else if(Sandesha2Constants.WSRM_COMMON.LAST_MSG.equals(qn.getLocalPart())){
+					lastMessageElement = child;
+				}
+			}
+		}
 		
 		identifier = new Identifier(namespaceValue);
+		identifier.fromOMElement(identifierPart);
 		messageNumber = new MessageNumber(namespaceValue);
-		identifier.fromOMElement(sequencePart);
-		messageNumber.fromOMElement(sequencePart);
-
-		OMElement lastMessageElement = sequencePart
-				.getFirstChildWithName(new QName(namespaceValue,Sandesha2Constants.WSRM_COMMON.LAST_MSG));
-
-		if (lastMessageElement != null) {
+		messageNumber.fromOMElement(msgNumberPart);
+		if(lastMessageElement != null){
 			lastMessage = new LastMessage(namespaceValue);
-			lastMessage.fromOMElement(sequencePart);
+			lastMessage.fromOMElement(lastMessageElement);
 		}
 
-    // Indicate that we have processed this part of the message.
-    ((SOAPHeaderBlock)sequencePart).setProcessed();
+		// Indicate that we have processed this part of the message.
+		shb.setProcessed();
     
 		return this;
 	}
-
+	
 	public OMElement toOMElement(OMElement headerElement) throws OMException {
 
 		if (headerElement == null || !(headerElement instanceof SOAPHeader))

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/SequenceAcknowledgement.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/SequenceAcknowledgement.java?rev=581820&r1=581819&r2=581820&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/SequenceAcknowledgement.java (original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/SequenceAcknowledgement.java Thu Oct  4 02:48:14 2007
@@ -50,6 +50,8 @@
 	private AckNone ackNone = null;
 	private AckFinal ackFinal = null;
 	
+	private OMElement originalSequenceAckElement;
+	
 	public SequenceAcknowledgement(String namespaceValue) throws SandeshaException {
 		if (!isNamespaceSupported(namespaceValue))
 			throw new SandeshaException (SandeshaMessageHelper.getMessage(
@@ -66,58 +68,51 @@
 	}
 
 	public Object fromOMElement(OMElement sequenceAckElement) throws OMException,SandeshaException {
-
-		identifier = new Identifier(namespaceValue);
-		identifier.fromOMElement(sequenceAckElement);
-
-		Iterator ackRangeParts = sequenceAckElement.getChildrenWithName(new QName(
-				namespaceValue, Sandesha2Constants.WSRM_COMMON.ACK_RANGE));
-
-		while (ackRangeParts.hasNext()) {
-			OMElement ackRangePart = (OMElement) ackRangeParts.next();
-
-			AcknowledgementRange ackRange = new AcknowledgementRange(namespaceValue);
-			ackRange.fromOMElement(ackRangePart);
-			acknowledgementRangeList.add(ackRange);
-		}
-
-		Iterator nackParts = sequenceAckElement.getChildrenWithName(new QName(
-				namespaceValue, Sandesha2Constants.WSRM_COMMON.NACK));
-
-		while (nackParts.hasNext()) {
-			OMElement nackPart = (OMElement) nackParts.next();
-			Nack nack = new Nack(namespaceValue);
-			nack.fromOMElement(nackPart);
-			nackList.add(nack);
-		}
-
-		String rmSpecVersion = SpecSpecificConstants.getSpecVersionString (namespaceValue);
-		
-		if (SpecSpecificConstants.isAckFinalAllowed(rmSpecVersion)) {
-			OMElement ackFinalPart = sequenceAckElement.getFirstChildWithName(new QName (namespaceValue,Sandesha2Constants.WSRM_COMMON.FINAL));
-			if (ackFinalPart!=null) {
-				ackFinal = new AckFinal (namespaceValue);
-				ackFinal.fromOMElement(sequenceAckElement);
+		originalSequenceAckElement = sequenceAckElement;
+		OMElement identifierPart = null;
+		Iterator childElements = sequenceAckElement.getChildElements();
+		while(childElements.hasNext()){
+			OMElement element = (OMElement)childElements.next();
+			String elementNamespace = element.getQName().getNamespaceURI();
+			String elementLocalName = element.getQName().getLocalPart();
+			if(namespaceValue.equals(elementNamespace)){
+				if(Sandesha2Constants.WSRM_COMMON.ACK_RANGE.equals(elementLocalName)){
+					AcknowledgementRange ackRange = new AcknowledgementRange(namespaceValue);
+					ackRange.fromOMElement(element);
+					acknowledgementRangeList.add(ackRange);
+				}else if(Sandesha2Constants.WSRM_COMMON.NACK.equals(elementLocalName)){
+					Nack nack = new Nack(namespaceValue);
+					nack.fromOMElement(element);
+					nackList.add(nack);
+				}else if(Sandesha2Constants.WSRM_COMMON.IDENTIFIER.equals(elementLocalName)){
+					identifierPart = element;
+				}else {
+					String rmSpecVersion = SpecSpecificConstants.getSpecVersionString (namespaceValue);
+					if (SpecSpecificConstants.isAckFinalAllowed(rmSpecVersion)) {
+						if(Sandesha2Constants.WSRM_COMMON.FINAL.equals(elementLocalName)){
+							ackFinal = new AckFinal (namespaceValue);
+							ackFinal.fromOMElement(element);
+						}
+					}
+					if (SpecSpecificConstants.isAckNoneAllowed(rmSpecVersion)) {
+						if(Sandesha2Constants.WSRM_COMMON.NONE.equals(elementLocalName)){
+							ackNone = new AckNone (namespaceValue);
+							ackNone.fromOMElement(element);
+						}
+					}
+				}
 			}
 		}
-		
-		if (SpecSpecificConstants.isAckNoneAllowed(rmSpecVersion)) {
-			OMElement ackNonePart = sequenceAckElement.getFirstChildWithName(new QName (namespaceValue,Sandesha2Constants.WSRM_COMMON.NONE));
-			if (ackNonePart!=null) {
-				ackNone = new AckNone (namespaceValue);
-				ackNone.fromOMElement(sequenceAckElement);
-			}
-		}
-		
-    // Indicate that we have processed this part of the message.
-    ((SOAPHeaderBlock)sequenceAckElement).setProcessed();
 
-    
+		identifier = new Identifier(namespaceValue);
+		identifier.fromOMElement(identifierPart);
+
+		// Indicate that we have processed this part of the message.
+		((SOAPHeaderBlock)sequenceAckElement).setProcessed();
 		return this;
 	}
-
+	
 	public OMElement toOMElement(OMElement header) throws OMException,SandeshaException {
-
 		if (header == null || !(header instanceof SOAPHeader))
 			throw new OMException();
 
@@ -280,6 +275,10 @@
 
 	public void setAckNone(AckNone ackNone) {
 		this.ackNone = ackNone;
+	}
+	
+	public OMElement getOriginalSequenceAckElement() {
+		return originalSequenceAckElement;
 	}
 	
 }

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/SequenceOffer.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/SequenceOffer.java?rev=581820&r1=581819&r2=581820&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/SequenceOffer.java (original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/SequenceOffer.java Thu Oct  4 02:48:14 2007
@@ -68,7 +68,10 @@
 					createSequenceElement.toString()));
 
 		identifier = new Identifier(namespaceValue);
-		identifier.fromOMElement(sequenceOfferPart);
+		OMElement identifierPart = sequenceOfferPart.getFirstChildWithName(new QName(namespaceValue, Sandesha2Constants.WSRM_COMMON.IDENTIFIER));
+		if(identifierPart != null){
+			identifier.fromOMElement(identifierPart);
+		}
 
 		OMElement expiresPart = sequenceOfferPart
 				.getFirstChildWithName(new QName(namespaceValue,Sandesha2Constants.WSRM_COMMON.EXPIRES));

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/TerminateSequence.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/TerminateSequence.java?rev=581820&r1=581819&r2=581820&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/TerminateSequence.java (original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/TerminateSequence.java Thu Oct  4 02:48:14 2007
@@ -68,7 +68,10 @@
 					body.toString()));
 
 		identifier = new Identifier(namespaceValue);
-		identifier.fromOMElement(terminateSeqPart);
+		OMElement identifierPart = terminateSeqPart.getFirstChildWithName(new QName(namespaceValue, Sandesha2Constants.WSRM_COMMON.IDENTIFIER));
+		if(identifierPart != null){
+			identifier.fromOMElement(identifierPart);
+		}
 
 		return this;
 	}

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/TerminateSequenceResponse.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/TerminateSequenceResponse.java?rev=581820&r1=581819&r2=581820&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/TerminateSequenceResponse.java (original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/wsrm/TerminateSequenceResponse.java Thu Oct  4 02:48:14 2007
@@ -70,7 +70,10 @@
 							body.toString()));
 
 		identifier = new Identifier(namespaceValue);
-		identifier.fromOMElement(terminateSeqResponsePart);
+		OMElement identifierPart = terminateSeqResponsePart.getFirstChildWithName(new QName(namespaceValue, Sandesha2Constants.WSRM_COMMON.IDENTIFIER));
+		if(identifierPart != null){
+			identifier.fromOMElement(identifierPart);
+		}
 
 		return this;
 	}

Modified: webservices/sandesha/trunk/java/modules/tests/src/test/java/org/apache/sandesha2/SandeshaTestCase.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/tests/src/test/java/org/apache/sandesha2/SandeshaTestCase.java?rev=581820&r1=581819&r2=581820&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/modules/tests/src/test/java/org/apache/sandesha2/SandeshaTestCase.java (original)
+++ webservices/sandesha/trunk/java/modules/tests/src/test/java/org/apache/sandesha2/SandeshaTestCase.java Thu Oct  4 02:48:14 2007
@@ -71,7 +71,7 @@
 
 	protected SimpleHTTPServer httpServer = null;
 	protected int serverPort = DEFAULT_SERVER_TEST_PORT;
-	protected int waitTime = 60000; // Each test will wait up to 60 seconds, unless we override it here
+	protected int waitTime = 70000; // Each test will wait up to 70 seconds, unless we override it here
 	protected int tickTime = 1000;  // Each wait will check the test assertions each second
 	protected String pingAction = "urn:wsrm:Ping";
 	protected String echoAction = "urn:wsrm:EchoString";

Modified: webservices/sandesha/trunk/java/modules/tests/src/test/java/org/apache/sandesha2/wsrm/SequenceTest.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/tests/src/test/java/org/apache/sandesha2/wsrm/SequenceTest.java?rev=581820&r1=581819&r2=581820&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/modules/tests/src/test/java/org/apache/sandesha2/wsrm/SequenceTest.java (original)
+++ webservices/sandesha/trunk/java/modules/tests/src/test/java/org/apache/sandesha2/wsrm/SequenceTest.java Thu Oct  4 02:48:14 2007
@@ -39,7 +39,7 @@
     public void testFromOMElement()  throws SandeshaException {
         SOAPEnvelope env = getSOAPEnvelope("", "Sequence.xml");
         Sequence sequence = new Sequence(rmNamespace);
-        sequence.fromOMElement(env.getHeader());
+        sequence.fromOMElement(env.getHeader().getFirstChildWithName(Sandesha2Constants.SPEC_2005_02.QNames.Sequence));
 
         Identifier identifier = sequence.getIdentifier();
         assertEquals("uuid:879da420-1624-11da-bed9-84d13db13902", identifier.getIdentifier());



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


Mime
View raw message