axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "R J Scheuerle Jr" <>
Subject JavaUtils.convert() for returned values ?
Date Tue, 04 Dec 2001 18:11:38 GMT
RPCProvider uses the JavaUtils.convert() method to massage List <--> array
Shouldn't it also use JavaUtils.convert() to massage the returned object so
that the Stub classes can assume that the
returned value has the correct type?

The simple fix for now is to add a JavaUtils.convert(...) invocation to the
stub to massage the returned ArrayList to an int[ ].

Comments Please.
Rich Scheuerle
XML & Web Services Development
512-838-5115  (IBM TL 678-5115)

                    Russell Butek                                                        
                                         To:     R J Scheuerle Jr/Austin/IBM@IBMUS       
                    12/04/2001           cc:                                             
                    10:43 AM             From:   Russell Butek/Austin/IBM@IBMUS          
                                         Subject:     WSDL2Java emitter and arrays       

Russell Butek
---------------------- Forwarded by Russell Butek/Austin/IBM on 12/04/2001
10:41 AM ---------------------------

Rick Rineholt
12/04/2001 10:10 AM

To:   Russell Butek/Austin/IBM

From: Rick Rineholt/Raleigh/IBM@IBMUS
Subject:  WSDL2Java emitter and arrays

I have encountered a problem regarding WSDL emitter (wsdl2java)  with
regard to arrays.  The problem I see is that the emitter is generating a
stub that is casting the return type to an int array ( int[ ]);  however,
Axis is returning a java.util.ArrayList.    Is there something I need to
change in my WSDL?  Is this a bug?

The exception I see is:
java.lang.ClassCastException: java.util.ArrayList
        at EchoTest.main(

The stub is:
    public int[] echoIntegerArray(int[] inputIntegerArray) throws
(call.getProperty(org.apache.axis.transport.http.HTTPTransport.URL) ==
null) {
            throw new org.apache.axis.NoEndPointException();
        call.addParameter("inputIntegerArray", new
org.apache.axis.encoding.XMLType( new javax.xml.rpc.namespace.QName("", "ArrayOfint")),
        call.setReturnType(new org.apache.axis.encoding.XMLType(new

call.setProperty(org.apache.axis.transport.http.HTTPTransport.ACTION, "");
        call.setProperty(call.NAMESPACE, "");
        call.setOperationName( "echoIntegerArray");
        Object resp = call.invoke(new Object[] {inputIntegerArray});

        if (resp instanceof java.rmi.RemoteException) {
            throw (java.rmi.RemoteException)resp;
        else {
             return (int[]) resp;

Here is the complete WSDL:
(See attached file: echo.wsdl)

Rick Rineholt
"The truth is out there...  All you need is a better search engine!"

View raw message