You are viewing a plain text version of this content. The canonical link for it is here.
Posted to sandesha-dev@ws.apache.org by ch...@apache.org on 2006/09/07 12:33:18 UTC

svn commit: r441048 - in /webservices/sandesha/trunk/java/src/org/apache/sandesha2: Sandesha2Constants.java util/MsgInitializer.java util/RMMsgCreator.java wsrm/Address.java wsrm/MakeConnection.java wsrm/MessagePending.java wsrm/RMElements.java

Author: chamikara
Date: Thu Sep  7 03:33:17 2006
New Revision: 441048

URL: http://svn.apache.org/viewvc?view=rev&rev=441048
Log:
Added MakeConnection and MessagePending message parts.
Added code to initialize MakeConnection and MessagePending messages.


Added:
    webservices/sandesha/trunk/java/src/org/apache/sandesha2/wsrm/MakeConnection.java
    webservices/sandesha/trunk/java/src/org/apache/sandesha2/wsrm/MessagePending.java
Modified:
    webservices/sandesha/trunk/java/src/org/apache/sandesha2/Sandesha2Constants.java
    webservices/sandesha/trunk/java/src/org/apache/sandesha2/util/MsgInitializer.java
    webservices/sandesha/trunk/java/src/org/apache/sandesha2/util/RMMsgCreator.java
    webservices/sandesha/trunk/java/src/org/apache/sandesha2/wsrm/Address.java
    webservices/sandesha/trunk/java/src/org/apache/sandesha2/wsrm/RMElements.java

Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/Sandesha2Constants.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/Sandesha2Constants.java?view=diff&rev=441048&r1=441047&r2=441048
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/Sandesha2Constants.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/Sandesha2Constants.java Thu Sep  7 03:33:17 2006
@@ -79,6 +79,8 @@
 			
 			String ACTION_CLOSE_SEQUENCE_RESPONSE = "http://docs.oasis-open.org/ws-rx/wsrm/200608/CloseSequenceResponse";
 			
+			String ACTION_MAKE_CONNECTION = "http://docs.oasisopen.org/ws-rx/wsrm/200608/MakeConnection";
+			
 			String SOAP_ACTION_CREATE_SEQUENCE = "http://docs.oasis-open.org/ws-rx/wsrm/200608/CreateSequence";
 
 			String SOAP_ACTION_CREATE_SEQUENCE_RESPONSE = "http://docs.oasis-open.org/ws-rx/wsrm/200608/CreateSequenceResponse";
@@ -92,6 +94,8 @@
 			String SOAP_ACTION_ACK_REQUEST = "http://docs.oasis-open.org/ws-rx/wsrm/200608/AckRequested";
 			
 			String SOAP_ACTION_CLOSE_SEQUENCE = "http://docs.oasis-open.org/ws-rx/wsrm/200608/CloseSequence";
+			
+			String SOAP_ACTION_MAKE_CONNECTION = "http://docs.oasisopen.org/ws-rx/wsrm/200608/MakeConnection";
 		}
 	}
 	
@@ -191,7 +195,9 @@
 
 		int FAULT_MSG = 10;
 		
-		int MAX_MESSAGE_TYPE = 10;
+		int MAKE_CONNECTION_MSG = 11;
+		
+		int MAX_MESSAGE_TYPE = 11;
 	}
 
 	public interface MessageParts {
@@ -218,8 +224,12 @@
 		int ACK_REQUEST = 15;
 
 		int USES_SEQUENCE_STR = 16;
+		
+		int MAKE_CONNECTION = 17;
+		
+		int MESSAGE_PENDING = 18;
 
-		int MAX_MSG_PART_ID = 16;
+		int MAX_MSG_PART_ID = 18;
 	}
 
 	public interface SequenceProperties {

Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/util/MsgInitializer.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/util/MsgInitializer.java?view=diff&rev=441048&r1=441047&r2=441048
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/util/MsgInitializer.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/util/MsgInitializer.java Thu Sep  7 03:33:17 2006
@@ -17,7 +17,6 @@
 
 package org.apache.sandesha2.util;
 
-import java.util.ArrayList;
 import java.util.Iterator;
 
 import org.apache.axis2.addressing.AddressingConstants;
@@ -37,6 +36,7 @@
 import org.apache.sandesha2.wsrm.CloseSequenceResponse;
 import org.apache.sandesha2.wsrm.CreateSequence;
 import org.apache.sandesha2.wsrm.CreateSequenceResponse;
+import org.apache.sandesha2.wsrm.MakeConnection;
 import org.apache.sandesha2.wsrm.RMElements;
 import org.apache.sandesha2.wsrm.Sequence;
 import org.apache.sandesha2.wsrm.SequenceAcknowledgement;
@@ -144,6 +144,16 @@
 			rmMsgContext.setMessagePart(Sandesha2Constants.MessageParts.USES_SEQUENCE_STR, elements
 					.getUsesSequenceSTR());
 		}
+		
+		if (elements.getMakeConnection() != null) {
+			rmMsgContext.setMessagePart(Sandesha2Constants.MessageParts.MAKE_CONNECTION,
+					elements.getMakeConnection());
+		}
+		
+		if (elements.getMessagePending() != null) {
+			rmMsgContext.setMessagePart(Sandesha2Constants.MessageParts.MESSAGE_PENDING,
+					elements.getMessagePending());
+		}
 
 		rmMsgContext.setRMNamespaceValue(rmNamespace);
 
@@ -169,22 +179,26 @@
 
 		String sequenceID = null;
 
-		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);
-		AckRequested ackRequest = (AckRequested) rmMsgCtx.getMessagePart(Sandesha2Constants.MessageParts.ACK_REQUEST);
-		CloseSequence closeSequence = (CloseSequence) rmMsgCtx
-				.getMessagePart(Sandesha2Constants.MessageParts.CLOSE_SEQUENCE);
-		CloseSequenceResponse closeSequenceResponse = (CloseSequenceResponse) rmMsgCtx
-				.getMessagePart(Sandesha2Constants.MessageParts.CLOSE_SEQUENCE_RESPONSE);
+		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);
+		AckRequested ackRequest = (AckRequested) rmMsgCtx.getMessagePart(
+				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) {
@@ -215,7 +229,18 @@
 			sequenceID = closeSequence.getIdentifier().getIdentifier();
 		} else if (closeSequenceResponse != null) {
 			rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.CLOSE_SEQUENCE_RESPONSE);
-			sequenceID = closeSequenceResponse.getIdentifier().getIdentifier();
+			sequenceID = closeSequenceResponse.getIdentifier().getIdentifier(); 
+		} else if (makeConnection != null){ {
+			rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.MAKE_CONNECTION_MSG);
+			if (makeConnection.getIdentifier()!=null) {
+				sequenceID = makeConnection.getIdentifier().getIdentifier();
+			} else if (makeConnection.getAddress()!=null){
+				//TODO get sequenceId based on the anonymous address.
+			} else {
+				throw new SandeshaException (
+						"Invalid MakeConnection message. Either Address or Identifier must be present");
+			}
+		}
 		} else
 			rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.UNKNOWN);
 

Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/util/RMMsgCreator.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/util/RMMsgCreator.java?view=diff&rev=441048&r1=441047&r2=441048
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/util/RMMsgCreator.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/util/RMMsgCreator.java Thu Sep  7 03:33:17 2006
@@ -307,7 +307,7 @@
 		if (replyToEPR != null)
 			createSeqRMMsg.setReplyTo(replyToEPR);
 
-		createSequencePart.setAcksTo(new AcksTo(new Address(acksToEPR, factory, addressingNamespaceValue), factory,
+		createSequencePart.setAcksTo(new AcksTo(new Address(acksToEPR, addressingNamespaceValue), factory,
 				rmNamespaceValue, addressingNamespaceValue));
 		
 		// Find the token that should be used to secure this new sequence. If there is a token, then we

Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/wsrm/Address.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/wsrm/Address.java?view=diff&rev=441048&r1=441047&r2=441048
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/wsrm/Address.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/wsrm/Address.java Thu Sep  7 03:33:17 2006
@@ -32,8 +32,8 @@
 		this.namespaceValue = namespaceValue;
 	}
 	
-	public Address (EndpointReference epr,OMFactory factory,String addressingNamespaceValue) {
-		this(addressingNamespaceValue);
+	public Address (EndpointReference epr,String namespaceValue) {
+		this(namespaceValue);
 		this.epr = epr;
 	}
 

Added: webservices/sandesha/trunk/java/src/org/apache/sandesha2/wsrm/MakeConnection.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/wsrm/MakeConnection.java?view=auto&rev=441048
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/wsrm/MakeConnection.java (added)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/wsrm/MakeConnection.java Thu Sep  7 03:33:17 2006
@@ -0,0 +1,140 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.sandesha2.wsrm;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMException;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMNamespace;
+import org.apache.axiom.soap.SOAPBody;
+import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.sandesha2.Sandesha2Constants;
+import org.apache.sandesha2.SandeshaException;
+import org.apache.sandesha2.i18n.SandeshaMessageHelper;
+import org.apache.sandesha2.i18n.SandeshaMessageKeys;
+
+public class MakeConnection implements IOMRMPart {
+
+	private String namespaceValue = null;
+	
+	Identifier identifier = null;
+	
+	Address address = null;
+	
+	public MakeConnection (String namespaceValue) throws SandeshaException {
+		if (!isNamespaceSupported(namespaceValue))
+			throw new SandeshaException (SandeshaMessageHelper.getMessage(
+					SandeshaMessageKeys.specDoesNotSupportElement,
+					namespaceValue,Sandesha2Constants.WSRM_COMMON.ACK_REQUESTED));
+		this.namespaceValue = namespaceValue;
+	}
+
+	public void toSOAPEnvelope(SOAPEnvelope envelope) throws SandeshaException {
+		SOAPBody body = envelope.getBody();
+		
+		//detach if already exist.
+		OMElement elem = body.getFirstChildWithName(new QName(namespaceValue,
+				Sandesha2Constants.WSRM_COMMON.MAKE_CONNECTION));
+		if (elem!=null)
+			elem.detach();
+		
+		toOMElement(body);
+	}
+
+	public Object fromOMElement(OMElement makeConnectionElement) throws OMException, SandeshaException {
+
+		OMElement identifierElement = makeConnectionElement.getFirstChildWithName(new QName(namespaceValue, Sandesha2Constants.WSRM_COMMON.IDENTIFIER));
+		OMElement addressElement = makeConnectionElement.getFirstChildWithName(new QName(namespaceValue,Sandesha2Constants.WSA.ADDRESS));
+		
+		if (identifierElement==null && addressElement==null) {
+			String message = "MakeConnection element should have at lease one of Address and Identifier subelements";
+			throw new SandeshaException (message);
+		}
+		
+		if (identifierElement!=null) {
+			identifier = new Identifier (namespaceValue);
+			identifier.fromOMElement(makeConnectionElement);
+		}
+		
+		if (addressElement!=null) {
+			address = new Address (namespaceValue);
+			address.fromOMElement(makeConnectionElement);
+		}
+		
+		return this;
+	}
+
+	public String getNamespaceValue() {
+		return namespaceValue;
+	}
+
+	public boolean isNamespaceSupported(String namespaceName) {
+		if (Sandesha2Constants.SPEC_2005_02.NS_URI.equals(namespaceName))
+			return false;
+		
+		if (Sandesha2Constants.SPEC_2006_08.NS_URI.equals(namespaceName))
+			return true;
+		
+		return false;
+	}
+
+	public OMElement toOMElement(OMElement body) throws OMException, SandeshaException {
+
+		if (body == null || !(body instanceof SOAPBody)) {
+			String message = "MakeConnection element can only be added to a SOAP Body ";
+			throw new OMException(
+					SandeshaMessageHelper.getMessage(message));
+		}
+
+		if (identifier==null && address==null) {
+			String message = "Invalid MakeConnection object. Both Identifier and Address are null";
+		}
+		
+		OMFactory factory = body.getOMFactory();
+		OMNamespace rmNamespace = factory.createOMNamespace(namespaceValue,Sandesha2Constants.WSRM_COMMON.NS_PREFIX_RM);
+
+		OMElement makeConnectionElement = factory.createOMElement(Sandesha2Constants.WSRM_COMMON.MAKE_CONNECTION,rmNamespace);
+		
+		if (identifier!=null)
+			identifier.toOMElement(makeConnectionElement);
+		if (address!=null)
+			address.toOMElement(makeConnectionElement);
+
+		body.addChild(makeConnectionElement);
+		
+		return body;
+	}
+
+	public Address getAddress() {
+		return address;
+	}
+
+	public void setAddress(Address address) {
+		this.address = address;
+	}
+
+	public Identifier getIdentifier() {
+		return identifier;
+	}
+
+	public void setIdentifier(Identifier identifier) {
+		this.identifier = identifier;
+	}
+
+}

Added: webservices/sandesha/trunk/java/src/org/apache/sandesha2/wsrm/MessagePending.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/wsrm/MessagePending.java?view=auto&rev=441048
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/wsrm/MessagePending.java (added)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/wsrm/MessagePending.java Thu Sep  7 03:33:17 2006
@@ -0,0 +1,125 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.sandesha2.wsrm;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axiom.om.OMAttribute;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMException;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMNamespace;
+import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.axiom.soap.SOAPHeader;
+import org.apache.axiom.soap.SOAPHeaderBlock;
+import org.apache.axis2.Constants;
+import org.apache.sandesha2.Sandesha2Constants;
+import org.apache.sandesha2.SandeshaException;
+import org.apache.sandesha2.i18n.SandeshaMessageHelper;
+import org.apache.sandesha2.i18n.SandeshaMessageKeys;
+
+public class MessagePending implements IOMRMPart {
+
+	boolean pending = false;
+	String namespaceValue = null;
+	
+	public MessagePending (String namespaceValue) throws SandeshaException {
+		if (!isNamespaceSupported(namespaceValue))
+			throw new SandeshaException (SandeshaMessageHelper.getMessage(
+					SandeshaMessageKeys.unknownSpec,
+					namespaceValue));
+		
+		this.namespaceValue = namespaceValue;
+	}
+	
+	public void toSOAPEnvelope(SOAPEnvelope envelope) throws SandeshaException {
+		SOAPHeader header = envelope.getHeader();
+		
+		//detach if already exist.
+		OMElement elem = header.getFirstChildWithName(new QName(namespaceValue,
+				Sandesha2Constants.WSRM_COMMON.MESSAGE_PENDING));
+		if (elem!=null)
+			elem.detach();
+		
+		toOMElement(header);
+	}
+
+	public String getNamespaceValue() {
+		return namespaceValue;
+	}
+
+	public Object fromOMElement(OMElement messagePendingElement) throws OMException,
+			SandeshaException {
+		
+		OMAttribute pendingAttr = messagePendingElement.getAttribute(new QName (Sandesha2Constants.WSRM_COMMON.PENDING));
+		if (pendingAttr==null) {
+			String message = "MessagePending header must have an attribute named 'pending'";
+			throw new SandeshaException (message);
+		}
+		
+		String value = pendingAttr.getAttributeValue();
+		if (Constants.VALUE_TRUE.equals(value))
+			pending = true;
+		else if (Constants.VALUE_FALSE.equals(value))
+			pending = false;
+		else {
+			String message = "Attribute 'pending' must have value 'true' or 'false'";
+			throw new SandeshaException (message);
+		}
+		
+		return messagePendingElement;
+	}
+
+	public OMElement toOMElement(OMElement headerElement) throws OMException,
+			SandeshaException {
+		if (!(headerElement instanceof SOAPHeader)) {
+			String message = "'MessagePending' element can only be added to a SOAP Header";
+			throw new OMException(message);
+		}
+		
+		SOAPHeader header = (SOAPHeader) headerElement;
+		OMFactory factory = header.getOMFactory();
+		OMNamespace namespace = factory.createOMNamespace(namespaceValue,Sandesha2Constants.WSRM_COMMON.NS_PREFIX_RM);
+		
+		SOAPHeaderBlock headerBlock = header.addHeaderBlock(Sandesha2Constants.WSRM_COMMON.MESSAGE_PENDING,namespace);
+		
+		OMAttribute attribute = factory.createOMAttribute(Sandesha2Constants.WSRM_COMMON.PENDING,null,new Boolean (pending).toString());
+		headerBlock.addAttribute(attribute);
+		
+		return headerElement;
+	}
+
+	public boolean isNamespaceSupported(String namespaceName) {
+		if (Sandesha2Constants.SPEC_2005_02.NS_URI.equals(namespaceName))
+			return false;
+		
+		if (Sandesha2Constants.SPEC_2006_08.NS_URI.equals(namespaceName))
+			return true;
+		
+		return false;
+	}
+
+	public boolean isPending() {
+		return pending;
+	}
+
+	public void setPending(boolean pending) {
+		this.pending = pending;
+	}
+
+	
+}

Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/wsrm/RMElements.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/wsrm/RMElements.java?view=diff&rev=441048&r1=441047&r2=441048
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/wsrm/RMElements.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/wsrm/RMElements.java Thu Sep  7 03:33:17 2006
@@ -56,6 +56,8 @@
 	private CloseSequenceResponse closeSequenceResponse = null;
 	private AckRequested ackRequested = null;
 	private UsesSequenceSTR usesSequenceSTR = null;
+	private MessagePending messagePending = null;
+	private MakeConnection makeConnection = null;
 	private String rmNamespaceValue = null;
 	private String addressingNamespaceValue = null;
 	
@@ -193,6 +195,22 @@
 			usesSequenceSTR = new UsesSequenceSTR(factory, rmNamespaceValue);
 			usesSequenceSTR.fromOMElement(envelope.getHeader());
 		}
+		
+		OMElement makeConnectionElement = envelope.getBody().getFirstChildWithName(
+				new QName (rmNamespaceValue,
+						Sandesha2Constants.WSRM_COMMON.MAKE_CONNECTION));
+		if (makeConnectionElement!=null) {
+			makeConnection = new MakeConnection (rmNamespaceValue);
+			makeConnection.fromOMElement(makeConnectionElement);
+		}
+		
+		OMElement messagePendingElement = envelope.getHeader().getFirstChildWithName(
+				new QName (rmNamespaceValue,
+						Sandesha2Constants.WSRM_COMMON.MESSAGE_PENDING));
+		if (messagePendingElement!=null) {
+			messagePending = new MessagePending (rmNamespaceValue);
+			messagePending.fromOMElement(messagePendingElement);
+		}
 	}
 
 	public SOAPEnvelope toSOAPEnvelope(SOAPEnvelope envelope) throws SandeshaException  {
@@ -228,6 +246,14 @@
 			closeSequenceResponse.toOMElement(envelope.getBody());
 		}
 		
+		if (makeConnection!=null) {
+			makeConnection.toOMElement(envelope.getBody());
+		}
+		
+		if (messagePending!=null) {
+			messagePending.toOMElement(envelope.getHeader());
+		}
+		
 		return envelope;
 	}
 
@@ -293,6 +319,14 @@
 		this.ackRequested = ackRequested;
 	}
 	
+	public void setMakeConnection(MakeConnection makeConnection) {
+		this.makeConnection = makeConnection;
+	}
+	
+	public void setMessagePending(MessagePending messagePending) {
+		this.messagePending = messagePending;
+	}
+	
 	private String getRMNamespaceValue (SOAPEnvelope envelope, String action) {
 		SOAPHeader header = envelope.getHeader();
 		if (header!=null) {
@@ -332,6 +366,8 @@
 			return Sandesha2Constants.SPEC_2006_08.NS_URI;
 		if (action.equals(Sandesha2Constants.SPEC_2006_08.Actions.ACTION_CLOSE_SEQUENCE_RESPONSE))
 			return Sandesha2Constants.SPEC_2006_08.NS_URI;
+		if (action.equals(Sandesha2Constants.SPEC_2006_08.Actions.ACTION_MAKE_CONNECTION))
+			return Sandesha2Constants.SPEC_2006_08.NS_URI;
 		
 		return null;   //a version could not be found
 	}
@@ -377,5 +413,13 @@
 
 	public String getAddressingNamespaceValue() {
 		return addressingNamespaceValue;
+	}
+
+	public MakeConnection getMakeConnection() {
+		return makeConnection;
+	}
+
+	public MessagePending getMessagePending() {
+		return messagePending;
 	}
 }



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