Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 28252 invoked from network); 6 Sep 2007 19:56:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Sep 2007 19:56:16 -0000 Received: (qmail 94617 invoked by uid 500); 6 Sep 2007 19:56:09 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 94496 invoked by uid 500); 6 Sep 2007 19:56:09 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 94485 invoked by uid 500); 6 Sep 2007 19:56:09 -0000 Delivered-To: apmail-ws-axis2-cvs@ws.apache.org Received: (qmail 94482 invoked by uid 99); 6 Sep 2007 19:56:09 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Sep 2007 12:56:09 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Sep 2007 19:57:33 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 069F81A9832; Thu, 6 Sep 2007 12:55:51 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: axis2-cvs@ws.apache.org From: nthaker@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20070906195551.069F81A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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