axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tony Blair <>
Subject Re: Retrieve objects from SOAP response
Date Fri, 20 Feb 2004 18:32:29 GMT
Hi there,
One thing that I noticed is your :
call.addParameter( "outMsg", XMLType.XSD_ANYTYPE, ParameterMode.IN ); you need pass the qName
as oppose to XMLType.XSD_ANTYPE.
Try this.
Tony. wrote:

I have a SOAP service that returns objects. I know the method works, cos' I can see the output
in TCPMON, However when I try to retrieve them I get a StringIndexOutOfBoundException 

This is my code for creating and sending the request. 
I have registered all the appropriate Serializers and Deserializers for the object that I
am sending and hope to receive 

call.setOperationName(new QName("urn:ExpoServiceInterface", "executeRequest"));          

Class beanSF = BeanSerializerFactory.class; 
Class beanDF = BeanDeserializerFactory.class;                   
QName qName = new javax.xml.namespace.QName("OC315SearchRequest", "OC315SearchRequest"); 
call.registerTypeMapping(OC315SearchRequest.class, qName, beanSF, beanDF); 
qName = new javax.xml.namespace.QName("EIResponse", "EIResponse"); 
call.registerTypeMapping(EIResponse.class, qName, beanSF, beanDF); 

call.addParameter( "outMsg", XMLType.XSD_ANYTYPE, ParameterMode.IN ); 
call.setReturnType(new QName("EIResponse", "EIResponse"), EIResponse.class);             
EIResponse obj = (EIResponse) call.invoke(new Object[] {request}); 

When I run this method I get this exception, Can anyone tell me how to retrieve objects from
a SOAP response. 

 faultCode: {}Server.userException 
 faultString: java.lang.StringIndexOutOfBoundsException: String index out of range: 0 
        {}stackTrace: java.lang.StringIndexOutOfBoundsException:
String index out of range: 0 
        at org.apache.axis.encoding.ser.SimpleDeserializer.onEndElement(

        at org.apache.axis.encoding.DeserializerImpl.endElement(

        at org.apache.axis.encoding.DeserializationContextImpl.endElement(

        at org.apache.axis.message.SAX2EventRecorder.replay( 
        at org.apache.axis.message.MessageElement.publishToHandler(

        at org.apache.axis.message.RPCElement.deserialize( 
        at org.apache.axis.message.RPCElement.getParams( 
        at org.apache.axis.client.Call.invoke( 
        at org.apache.axis.client.Call.invoke( 
        at org.apache.axis.client.Call.invoke( 
        at SoapRequestImpl.runExecuteRequest( 
        at SoapRequestImpl.main( 


Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
View raw message