You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by ru...@apache.org on 2005/09/28 17:49:52 UTC

svn commit: r292217 - in /webservices/axis2/trunk/java/modules: common/src/org/apache/axis2/i18n/ core/src/org/apache/axis2/clientapi/ core/src/org/apache/axis2/description/ security/src/org/apache/axis2/security/ security/src/org/apache/axis2/security...

Author: ruchithf
Date: Wed Sep 28 08:49:22 2005
New Revision: 292217

URL: http://svn.apache.org/viewcvs?rev=292217&view=rev
Log:
Fixging AXIS2-242 for blocking messages, added missing mapping into i18n/resource.properties and updated the security handlers to pick the signature values to verify signature confirmation from the request message context

Modified:
    webservices/axis2/trunk/java/modules/common/src/org/apache/axis2/i18n/resource.properties
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/clientapi/InOutMEPClient.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/clientapi/TwoWayTransportBasedSender.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OperationDescription.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/WSDoAllReceiver.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/WSDoAllSender.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/util/Axis2Util.java

Modified: webservices/axis2/trunk/java/modules/common/src/org/apache/axis2/i18n/resource.properties
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/common/src/org/apache/axis2/i18n/resource.properties?rev=292217&r1=292216&r2=292217&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/common/src/org/apache/axis2/i18n/resource.properties (original)
+++ webservices/axis2/trunk/java/modules/common/src/org/apache/axis2/i18n/resource.properties Wed Sep 28 08:49:22 2005
@@ -96,4 +96,5 @@
 invalidphase=Invalid Phase : {0} for the handler {1} does not exit in axis2.xml or refering to phase in diffrent flow
 invalidmodulerefbyconfig=reference to invalid module  {0}    by axis2.xml
 phasedosenotspecified=Phase does not specified for the handler {0}
-servicemodulecannothaveglobal=Service specific module can not refer system pre defined phases :  {0}
\ No newline at end of file
+servicemodulecannothaveglobal=Service specific module can not refer system pre defined phases :  {0}
+cannotCorrelateMsg=Cannot correlate MessageID {1} to {0} 
\ No newline at end of file

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/clientapi/InOutMEPClient.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/clientapi/InOutMEPClient.java?rev=292217&r1=292216&r2=292217&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/clientapi/InOutMEPClient.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/clientapi/InOutMEPClient.java Wed Sep 28 08:49:22 2005
@@ -21,6 +21,7 @@
 import org.apache.axis2.addressing.EndpointReference;
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.context.OperationContext;
 import org.apache.axis2.context.OperationContextFactory;
 import org.apache.axis2.context.ServiceContext;
 import org.apache.axis2.description.OperationDescription;
@@ -168,11 +169,11 @@
             checkTransport(msgctx);
 
             //find and set the Operation Context
-            ConfigurationContext sysContext = serviceContext.getEngineContext();
-            AxisConfiguration registry = sysContext.getAxisConfiguration();
-            msgctx.setOperationContext(OperationContextFactory.createOperationContext(WSDLConstants.MEP_CONSTANT_IN_OUT,
+            OperationContext operationContext = OperationContextFactory.createOperationContext(WSDLConstants.MEP_CONSTANT_IN_OUT,
                     axisop,
-                    serviceContext));
+                    serviceContext);
+            axisop.registerOperationContext(msgctx,operationContext);
+
             //Send the SOAP Message and receive a response                
             MessageContext response =
                     TwoWayTransportBasedSender.send(msgctx, listenerTransport);

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/clientapi/TwoWayTransportBasedSender.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/clientapi/TwoWayTransportBasedSender.java?rev=292217&r1=292216&r2=292217&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/clientapi/TwoWayTransportBasedSender.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/clientapi/TwoWayTransportBasedSender.java Wed Sep 28 08:49:22 2005
@@ -42,8 +42,8 @@
                         msgctx.getTransportOut());
         response.setProperty(MessageContext.TRANSPORT_IN,
                 msgctx.getProperty(MessageContext.TRANSPORT_IN));
+        msgctx.getOperationDescription().registerOperationContext(response,msgctx.getOperationContext());
         response.setServerSide(false);
-        response.setOperationContext(msgctx.getOperationContext());
         response.setServiceContext(msgctx.getServiceContext());
         response.setServiceGroupContext(msgctx.getServiceGroupContext());
 

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OperationDescription.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OperationDescription.java?rev=292217&r1=292216&r2=292217&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OperationDescription.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OperationDescription.java Wed Sep 28 08:49:22 2005
@@ -207,7 +207,7 @@
                             msgContext.getRelatesTo().getValue());
 
             if (null == operationContext) {
-                throw new AxisFault(Messages.getMessage("cannotCorrealteMsg",
+                throw new AxisFault(Messages.getMessage("cannotCorrelateMsg",
                         this.getName().toString(),msgContext.getRelatesTo().getValue()));
             }
 
@@ -228,6 +228,10 @@
     public OperationContext findForExistingOperationContext(MessageContext msgContext) throws AxisFault {
         OperationContext operationContext = null;
 
+        if((operationContext = msgContext.getOperationContext()) != null) {
+        	return operationContext;
+        }
+        
         if (null == msgContext.getRelatesTo()) {
             return null;
         } else {

Modified: webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/WSDoAllReceiver.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/WSDoAllReceiver.java?rev=292217&r1=292216&r2=292217&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/WSDoAllReceiver.java (original)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/WSDoAllReceiver.java Wed Sep 28 08:49:22 2005
@@ -18,6 +18,7 @@
 
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.context.OperationContext;
 import org.apache.axis2.om.OMException;
 import org.apache.axis2.security.handler.WSDoAllHandler;
 import org.apache.axis2.security.handler.WSSHandlerConstants;
@@ -36,13 +37,15 @@
 import org.apache.ws.security.handler.WSHandlerResult;
 import org.apache.ws.security.message.token.Timestamp;
 import org.apache.ws.security.util.WSSecurityUtil;
+import org.apache.wsdl.WSDLConstants;
 import org.w3c.dom.Document;
 
-import javax.security.auth.callback.CallbackHandler;
 import java.security.cert.X509Certificate;
 import java.util.Iterator;
 import java.util.Vector;
 
+import javax.security.auth.callback.CallbackHandler;
+
 public class WSDoAllReceiver extends WSDoAllHandler {
 
     protected static Log log = LogFactory.getLog(WSDoAllReceiver.class.getName());
@@ -61,18 +64,12 @@
     	 * mc when this handler runs in the client side.
     	 */
     	
-//    	//Copy the WSHandlerConstants.SEND_SIGV over to the new message 
-//    	//context - if it exists
-//    	if(!msgContext.isServerSide()) {//To make sure this is a response message 
-//    		OperationContext opCtx = msgContext.getOperationContext();
-//    		MessageContext outMsgCtx = opCtx.getMessageContext(WSDLConstants.MESSAGE_LABEL_OUT);
-//    		msgContext.setProperty(WSHandlerConstants.SEND_SIGV,outMsgCtx.getProperty(WSHandlerConstants.SEND_SIGV));
-//    	}
-//    	
-    	
-    	//Getting the signature values using a static hook
-    	if(!msgContext.isServerSide()) {
-    		msgContext.setProperty(WSHandlerConstants.SEND_SIGV,Axis2Util.getSignatureValues());
+    	//Copy the WSHandlerConstants.SEND_SIGV over to the new message 
+    	//context - if it exists
+    	if(!msgContext.isServerSide()) {//To make sure this is a response message 
+    		OperationContext opCtx = msgContext.getOperationContext();
+    		MessageContext outMsgCtx = opCtx.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN);
+    		msgContext.setProperty(WSHandlerConstants.SEND_SIGV,outMsgCtx.getProperty(WSHandlerConstants.SEND_SIGV));
     	}
     	
         if (doDebug) {

Modified: webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/WSDoAllSender.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/WSDoAllSender.java?rev=292217&r1=292216&r2=292217&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/WSDoAllSender.java (original)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/WSDoAllSender.java Wed Sep 28 08:49:22 2005
@@ -255,20 +255,7 @@
 		        }
 	        }
 	        
-            /**
-             * Set the signature values
-             * this is a bad way of doing this
-             * we shoudl be able to keep this in the message context and 
-             * retrieve the value at the response. But right now this is not 
-             * possible since we don't have access to the req mc at the response
-             * in the CLIENT side
-             */
-            if(!msgContext.isServerSide()) {
-            	Axis2Util.setSignatureValues((Vector)msgContext.getProperty(WSHandlerConstants.SEND_SIGV));
-            	
-            }
-
-            if (doDebug) {
+	        if (doDebug) {
 				log.debug("WSDoAllSender: exit invoke()");
 			}
         } catch (WSSecurityException e) {

Modified: webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/util/Axis2Util.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/util/Axis2Util.java?rev=292217&r1=292216&r2=292217&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/util/Axis2Util.java (original)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/util/Axis2Util.java Wed Sep 28 08:49:22 2005
@@ -29,21 +29,18 @@
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.stream.XMLInputFactory;
 import javax.xml.stream.XMLStreamReader;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.util.Vector;
 
 /**
  * Utility class for the Axis2-WSS4J Module
  */
 public class Axis2Util {
 
-	private static ThreadLocal signatureValues = new ThreadLocal();
-	
-	
 	/**
 	 * Create a DOM Document using the SOAP Envelope
 	 * @param env An org.apache.axis2.soap.SOAPEnvelope instance 
@@ -165,11 +162,4 @@
 
 	}
 
-	public static Vector getSignatureValues() {
-		return (Vector)signatureValues.get();
-	}
-
-	public static void setSignatureValues(Vector signatureValues) {
-		Axis2Util.signatureValues.set(signatureValues);
-	}
 }