axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 14666] New: - NullPointerException taken in ArraySerializer when specifying array as input parameter.
Date Tue, 19 Nov 2002 02:27:17 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14666>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14666

NullPointerException taken in ArraySerializer when specifying array as input parameter.

           Summary: NullPointerException taken in ArraySerializer when
                    specifying array as input parameter.
           Product: Axis
           Version: 1.0
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Basic Architecture
        AssignedTo: axis-dev@xml.apache.org
        ReportedBy: revans@viaserv.com


This bug report entered as suggested by Davanum Srinivas.

Using 1.0 version of Axis, I receive NullPointerException in Axis client
application that specifies an array for an input parameter.  Problem appears to
be resolved in code change made 11/18/2002, 00:39, in SOAPPart.java (removing
log.debug call in setCurrentForm).  This problem did not occur in the RC1
release.  Test case below submitted for future testing of this issue.


/*
 * Test NullPointerException using Array input parameter.
 */

import org.apache.axis.client.Call;
import org.apache.axis.client.Service;

import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.soap.SOAPConstants;
import org.apache.axis.*;
import org.apache.axis.message.*;

import java.util.Vector;

public class InputArray {
  public static void main(String [] args ) {
    try {
      Service service = new Service();
      Call call = (Call) service.createCall();

      String tab_items [] = new String [4];
      tab_items [0] = "table item 1";
      tab_items [1] = "table item 1";
      tab_items [2] = "table item 1";
      tab_items [3] = "table item 1";

      call.addParameter("Input_Array", org.apache.axis.Constants.XSD_STRING,
javax.xml.rpc.ParameterMode.IN);
      call.addParameter("Result", org.apache.axis.Constants.XSD_STRING,
javax.xml.rpc.ParameterMode.OUT);

      call.setReturnType(org.apache.axis.Constants.XSD_STRING);
      call.setMaintainSession(true);

      String endpoint = "http://10.0.1.64:5505/tester";
      call.setTargetEndpointAddress(new java.net.URL(endpoint));
      call.setReturnType(org.apache.axis.Constants.XSD_STRING);
      call.setReturnClass(String.class);
      String ret = new String();

      RPCElement[] input = new RPCElement[1];
      RPCParam in_table = new RPCParam("http://local_service.com/",
"Input_Array", tab_items);

      input[0] = new RPCElement("http://10.0.1.64:5505/tester", "echoString",
new Object[]{in_table});
      Vector echo_elems = (Vector) call.invoke( input );     // actual invoke here.
      System.out.println("\n  Number of echo elements returned: " +
echo_elems.size());

    } catch (Exception e) {
      System.err.println(e.toString());
    }
  }
}



The stack trace from the NullPointerException is:
R:\AXIS-1_0\TESTCASE\InputArray>java InputArray
- Exception:
java.lang.NullPointerException
        at org.apache.axis.encoding.ser.ArraySerializer.serialize(ArraySerialize
r.java:111)
        at org.apache.axis.encoding.SerializationContextImpl.serializeActual(Ser
ializationContextImpl.java:1231)
        at org.apache.axis.encoding.SerializationContextImpl.serialize(Serializa
tionContextImpl.java:756)
        at org.apache.axis.message.RPCParam.serialize(RPCParam.java:224)
        at org.apache.axis.message.RPCElement.outputImpl(RPCElement.java:305)
        at org.apache.axis.message.MessageElement.output(MessageElement.java:746
)
        at org.apache.axis.message.SOAPBody.outputImpl(SOAPBody.java:142)
        at org.apache.axis.message.SOAPEnvelope.outputImpl(SOAPEnvelope.java:401
)
        at org.apache.axis.message.MessageElement.output(MessageElement.java:746
)
        at org.apache.axis.message.MessageElement.getAsString(MessageElement.jav
a:668)
        at org.apache.axis.message.MessageElement.toString(MessageElement.java:7
90)
        at java.lang.String.valueOf(String.java:2177)
        at java.lang.StringBuffer.append(StringBuffer.java:361)
        at org.apache.axis.SOAPPart.setCurrentForm(SOAPPart.java:308)
        at org.apache.axis.SOAPPart.setCurrentMessage(SOAPPart.java:300)
        at org.apache.axis.SOAPPart.<init>(SOAPPart.java:184)
        at org.apache.axis.Message.setup(Message.java:342)
        at org.apache.axis.Message.<init>(Message.java:245)
        at org.apache.axis.client.Call.invoke(Call.java:1293)
        at InputArray.main(InputArray.java:48)

Mime
View raw message