axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chinmoy Chakraborty (JIRA)" <j...@apache.org>
Subject [jira] Created: (AXIS2-3731) NPE when try to invoke service that return 3D object array
Date Fri, 11 Apr 2008 08:54:05 GMT
NPE when try to invoke service that return 3D object array
----------------------------------------------------------

                 Key: AXIS2-3731
                 URL: https://issues.apache.org/jira/browse/AXIS2-3731
             Project: Axis 2.0 (Axis2)
          Issue Type: Bug
         Environment: Win XP, Tomcat 5.0, Axis2 1.3, JRE 1.4.08, Axis 1.4 client
            Reporter: Chinmoy Chakraborty
            Priority: Minor


I got NPE when try to invoke service that return 3D object array. I am using Axis 1.4 client.

Service class:
------------------------------------------------

package com.objectarray.service;

public class ReturnObjectArrayService {

    public static Object[] returnObjectArray(String authToken) {
        Object[] retVal = new Object[3];
        Object[] args = new Object[3];
        args[0] = new Object[] {"Arg1", "Arg2", "Arg3"};
        args[1] = new Object[] {"Arg1", "Arg2", "Arg3"};
        args[2] = new Object[] {"Arg1", "Arg2", "Arg3"};

        retVal[0] = new Object[] {"RetVal1", "Retval2", authToken, args};
        retVal[1] = new Object[] {"RetVal3", "Retval4", authToken, args};
        retVal[2] = new Object[] {"RetVal5", "Retval6", authToken, args};
        return retVal;
    }
}

services.xml
---------------------------
<service name="return_object_array" targetNamespace="return_object_array">
   <description>
        This service is to get the array of objects
   </description>
   <schema schemaNamespace="return_object_array"/>
   <parameter name="ServiceClass">com.objectarray.service.ReturnObjectArrayService</parameter>
   <operation name="returnObjectArray">
   <messageReceiver  class="org.apache.axis2.rpc.receivers.RPCMessageReceiver" />
   </operation>
   <module ref="soapmonitor"/>
 </service>

axis 1.4 client code:
-----------------------------------
    Service service = new Service();
    Call call = (Call)service.createCall();
    call.setTimeout(CALL_TIMEOUT);
    call.setTargetEndpointAddress(wsServerUrl + "services/return_object_array");
    call.setOperationName( new QName("return_object_array", "returnObjectArray") );

    call.addParameter("authToken", XMLType.XSD_STRING, ParameterMode.IN );
    call.addParameter("reload", XMLType.XSD_BOOLEAN, ParameterMode.IN );
    call.setReturnType(XMLType.SOAP_ARRAY);

    Object[] Objs = (Object[])call.invoke(new Object[] {authToken, new Boolean(reload)});
------------------------------------------------------------------------------------------------------------------------------------
In the SOAPMonitor I see Axis2 sends back fault string
<faultcode>sopeenv:Server</faultcode>
<faultstring>java.lang.NullPointerException</faultstring>



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


Mime
View raw message