axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ntha...@apache.org
Subject svn commit: r573350 - in /webservices/axis2/trunk/java/modules: jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java metadata/src/org/apache/axis2/jaxws/i18n/resource.properties
Date Thu, 06 Sep 2007 19:55:50 GMT
Author: nthaker
Date: Thu Sep  6 12:55:49 2007
New Revision: 573350

URL: http://svn.apache.org/viewvc?rev=573350&view=rev
Log:
JIRA = AXIS2-3176

Fix for NPE when empty soap body is received in doc/lit bare scenario.

Modified:
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java
    webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/i18n/resource.properties

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java?rev=573350&r1=573349&r2=573350&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java
(original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java
Thu Sep  6 12:55:49 2007
@@ -639,18 +639,31 @@
             context.setIsxmlList(isList);
         }
         Block block = null;
+        boolean isBody = false;
         if (isHeader) {
             block = message.getHeaderBlock(headerNS, headerLocalPart, context, factory);
         } else {
             if (hasOutputBodyParams) {
                 block = message.getBodyBlock(0, context, factory);
+                isBody = true;
             } else {
                 // If there is only 1 block, we can use the get body block method
                 // that streams the whole block content.
                 block = message.getBodyBlock(context, factory);
+                //We look for body block only when the return type associated with operation
is not void.
+                //If a null body block is returned in response on a operation that is not
void, its a user error.               
+                isBody = true;
             }
         }
-
+        //We look for body block only when the return type associated with operation is not
void.
+        //If a null body block is returned in response on a operation that has non void return
type, its a user error.
+        if(isBody && block == null){
+           	if(log.isDebugEnabled()){
+           		log.debug("Empty Body Block Found in response Message for wsdl Operation defintion
that expects an Output");
+           		log.debug("Return type associated with SEI operation is not void, Body Block
cannot be null");
+           	}
+           	throw ExceptionFactory.makeWebServiceException(Messages.getMessage("MethodMarshallerUtilErr1"));

+        }
         // Get the business object.  We want to return the object that represents the type.
         Element returnElement = new Element(block.getBusinessObject(true), block.getQName());
         return returnElement;

Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/i18n/resource.properties
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/i18n/resource.properties?rev=573350&r1=573349&r2=573350&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/i18n/resource.properties
(original)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/i18n/resource.properties
Thu Sep  6 12:55:49 2007
@@ -161,6 +161,7 @@
 ClassUtilsErr3=An IOException error was thrown when trying to get all of the resources for
{0}
 ClassUtilsErr4=An IOException error was thrown when trying to read the jar file.
 MethodMarshallerErr1=A JAX-WS service exception for the {0} fault bean cannot be created.
+MethodMarshallerUtilErr1=Empty Body Block Found in response Message for wsdl Operation defintion
that expects an Output.
 SourceReadErr=A problem was encountered while reading the Source object.  Please verify that
your Source object is correct.  The class of the Source object is {0}
 JABGraphProblem=The system threw a StackOverflowError at the JAXB level.  This usually means
that your JAXB object has a circular reference.  This is not supported by JAXB.
 SchemaReaderErr1=Invlid wsdl Definition provided.



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


Mime
View raw message