You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Thilina Gunarathne (JIRA)" <ji...@apache.org> on 2006/09/21 14:24:23 UTC

[jira] Commented: (AXIS2-959) AxisFault when passing an array containing no elements

    [ http://issues.apache.org/jira/browse/AXIS2-959?page=comments#action_12436515 ] 
            
Thilina Gunarathne commented on AXIS2-959:
------------------------------------------

I was able to find the cause for this.. In the presence of an array with no elements, ADB passes NULL to the following method, which is acceptable..	

	/**
	 * Returns the number of elements in the array.
	 */
	public int countArrayOfInteger(int[] array) {
		return array.length;
	}

IMHO  the ideal scenario would have been to pass an array with 0 elements...

> AxisFault when passing an array containing no elements
> ------------------------------------------------------
>
>                 Key: AXIS2-959
>                 URL: http://issues.apache.org/jira/browse/AXIS2-959
>             Project: Apache Axis 2.0 (Axis2)
>          Issue Type: Bug
>    Affects Versions: 1.0
>            Reporter: William Ferguson
>         Assigned To: Thilina Gunarathne
>            Priority: Blocker
>         Attachments: ArrayService-client-source.jar, ArrayService-Source.jar, ArrayService.wsdl, TEST-au.com.hubbub.arrayws.ArrayService0Test.txt
>
>
> I have a service that accept an array of int as input and returns the number of elements in the array.
> The service + services. xml is deployed and the WSDL is retrieved from the AxisServlet. (source + WSDL attached).
> I generate the stubs and ADB classes using :
> <target name="generate.client" depends="init">
> <exec executable="${axis2.wsdl2java.home}/bin/WSDL2Java.bat">
> <arg line="-uri ${wsdl.uri}"/> <!-- uri from which to get WSDL -->
> <arg line="-o ${build}"/> <!-- Output directory in which to generate files -->
> <arg line="-p ${generated.package.name}"/> <!-- package in which to generate classes -->
> <arg line="-pn ${port.name}"/> <!-- Specify the port to hit -->
> <arg value="-s"/> <!-- Synchronous style only -->
> <!--<arg value="-t"/>--> <!-- Generate a TestCase -->
> <arg value="-u"/> <!-- Unpacks the data-Binding classes from the Stub -->
> </exec>
> </target>
> I then have a TestCase that exercises the method.
> If 0 elements are specified it serializes OK. The Soap enevelope is :
> <soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
> 	<soapenv:Header/>
> 	<soapenv:Body>
> 		<ns1:countArrayOfInteger xmlns:ns1="http://arrayws.hubbub.com.au/xsd"/>
> 	</soapenv:Body>
> </soapenv:Envelope>
> but causes an AxisFault (see attached testCase output)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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