axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kunal Gandhi <>
Subject Getting an IndexOutOfBoundsException
Date Sat, 04 Dec 2004 03:45:26 GMT

I am trying to deploy a Messaging Web Service which communicates with
another Web Service using RPC.
Following is my Messaging Service code.
public Element[] ReactionSearch(Element [] SOAPElements) {

//getting the string from the incoming SOAP Message from the client

   //Code to call the other Web Service using RPC
    service=new Service();
    call.setTargetEndpointAddress(new URL(rpcServerURL));
    QName qname=new QName("SearchDatabaseWebService","getReactionID");
    call.setReturnType( XMLType.XSD_STRING );
    paramlist=new Object[1];
    paramlist [0]=querystring;
    Object response=call.invoke(paramlist);

  //Getting a response from the other web service

  //Parsing the response string
    DocumentBuilderFactory builder=DocumentBuilderFactory.newInstance();
    Document document=builder.newDocumentBuilder().parse(new
InputSource(new StringReader(responsestring)));

//Creating the response element array
    SOAPresponse=new Element[2];
    SOAPresponse [0]=document.getDocumentElement();
    return SOAPresponse;
-- -------------------------------------------------------------------------------------------------------------

I have tested the RPC part of the above code separately and it is
working fine. The problem is that I am getting an Out of
BoundException in the above code. With the help of TCP Packet Monitor
and my firewall, I know that the client is communicating with the
above messaging service and the messaging service is also
communicating with the other web service. I guess the problem is when
the above messaging service wants to send a response back to the
client. The problem seems to be in the last three lines (the
SOAPresponse array) but cant figure out what it is ?

The stack Trace
ava.lang.IndexOutOfBoundsException: Index: 0, Size: 0

	at java.util.ArrayList.RangeCheck(

	at java.util.ArrayList.get(

	at org.apache.axis.message.SOAPBody.getFirstBody(

	at org.apache.axis.message.SOAPEnvelope.getFirstBody(

	at org.apache.axis.client.Call.invokeEngine(

	at org.apache.axis.client.Call.invoke(

	at org.apache.axis.client.Call.invoke(

Any kind of help will be appreciated


Kunal Gandhi
Graduate Student
Phone # (909)913-3245

View raw message