axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nand...@apache.org
Subject svn commit: r725307 - /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java
Date Wed, 10 Dec 2008 15:12:42 GMT
Author: nandana
Date: Wed Dec 10 07:12:42 2008
New Revision: 725307

URL: http://svn.apache.org/viewvc?rev=725307&view=rev
Log:
AXIS2-4114 check for possible NPE which caused a problem in rampart build

Modified:
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java?rev=725307&r1=725306&r2=725307&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java
Wed Dec 10 07:12:42 2008
@@ -1579,7 +1579,7 @@
         // If AxisBindingMessage is not set, try to find the binding message from the AxisService
         if (bindingMessage == null) {
         	bindingMessage = findBindingMessage();
-        } 
+        }
         
         if (bindingMessage != null) {
             return bindingMessage.getEffectivePolicy();
@@ -1592,15 +1592,21 @@
     }
  
     private AxisBindingMessage findBindingMessage() {
-    	if (axisService != null) {
+    	if (axisService != null && axisOperation != null ) {
 			if (axisService.getEndpointName() != null) {
 				AxisEndpoint axisEndpoint = axisService
 						.getEndpoint(axisService.getEndpointName());
 				if (axisEndpoint != null) {
 					AxisBinding axisBinding = axisEndpoint.getBinding();
-					AxisBindingOperation axisBindingOperation = (AxisBindingOperation) axisBinding
+                    AxisBindingOperation axisBindingOperation = (AxisBindingOperation) axisBinding
 							.getChild(axisOperation.getName());
-					String direction = axisMessage.getDirection();
+
+                    //If Binding Operation is not found, just return null
+                    if (axisBindingOperation == null) {
+                       return null;
+                    }
+
+                    String direction = axisMessage.getDirection();
 					AxisBindingMessage axisBindingMessage = null;
 					if (WSDLConstants.WSDL_MESSAGE_DIRECTION_IN
 							.equals(direction)



Mime
View raw message