axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "R J Scheuerle Jr" <sc...@us.ibm.com>
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
parameters.
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
butek@us.ibm.com
---------------------- 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
cc:

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



Russell,
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.util.ArrayList
java.lang.ClassCastException: java.util.ArrayList
        at com.ibm.www.EchoStub.echoIntegerArray(EchoStub.java:156)
        at EchoTest.main(EchoTest.java:62)


The stub is:
    public int[] echoIntegerArray(int[] inputIntegerArray) throws
java.rmi.RemoteException{
        if
(call.getProperty(org.apache.axis.transport.http.HTTPTransport.URL) ==
null) {
            throw new org.apache.axis.NoEndPointException();
        }
        call.removeAllParameters();
        call.addParameter("inputIntegerArray", new
org.apache.axis.encoding.XMLType( new javax.xml.rpc.namespace.QName("
http://www.ibm.com/wstkwsdl2java/xsd", "ArrayOfint")),
org.apache.axis.client.Call.PARAM_MODE_IN);
        call.setReturnType(new org.apache.axis.encoding.XMLType(new
javax.xml.rpc.namespace.QName("http://www.ibm.com/wstkwsdl2java/xsd",
"ArrayOfint")));


call.setProperty(org.apache.axis.transport.http.HTTPTransport.ACTION, "
http://www.ibm.com/wsdl2java/echo/");
        call.setProperty(call.NAMESPACE, "
http://tempuri.org/wwwibmcom_wsdl2java_echo");
        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!"

rineholt@us.ibm.com




Mime
View raw message