Returning java.util.List in Axis

Discussion in 'Java' started by rf3@rocketmail.com, Dec 23, 2004.

  1. Guest

    Hi,

    When I generate the classes using a WSDL I get a return type of
    Object[] instead of the java.util.List object. From what I understand
    List is serializable.
    Any reason why it is changing the return type to Object[]?

    Thanks,

    -R
    , Dec 23, 2004
    #1
    1. Advertising

  2. Guest

    Here's a little more info on this subject:

    I am using apache axis 1.1

    Java interface used to generate WSDL.
    //**** iDAO.java
    import java.util.List;

    public interface iDAO {
    public List executeQuery(String s);
    public int executeUpdate(String s);
    }


    WSDL file generate by running Java2WSDL using iDAO.class (above)
    //****daoservice.wsdl
    <?xml version="1.0" encoding="UTF-8"?>
    <wsdl:definitions targetNamespace="http://Interface.daopackage"
    xmlns:impl="http://Interface.daopackage"
    xmlns:intf="http://Interface.daopackage"
    xmlns:apachesoap="http://xml.apache.org/xml-soap"
    xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns="http://schemas.xmlsoap.org/wsdl/">
    <wsdl:message name="executeUpdateResponse">
    <wsdl:part name="executeUpdateReturn" type="xsd:int"/>
    </wsdl:message>
    <wsdl:message name="executeQueryResponse">
    <wsdl:part name="executeQueryReturn" type="soapenc:Array"/>
    </wsdl:message>
    <wsdl:message name="executeQueryRequest">
    <wsdl:part name="in0" type="xsd:string"/>
    </wsdl:message>
    <wsdl:message name="executeUpdateRequest">
    <wsdl:part name="in0" type="xsd:string"/>
    </wsdl:message>
    <wsdl:portType name="iDAO">
    <wsdl:eek:peration name="executeQuery" parameterOrder="in0">
    <wsdl:input name="executeQueryRequest"
    message="impl:executeQueryRequest"/>
    <wsdl:eek:utput name="executeQueryResponse"
    message="impl:executeQueryResponse"/>
    </wsdl:eek:peration>
    <wsdl:eek:peration name="executeUpdate" parameterOrder="in0">
    <wsdl:input name="executeUpdateRequest"
    message="impl:executeUpdateRequest"/>
    <wsdl:eek:utput name="executeUpdateResponse"
    message="impl:executeUpdateResponse"/>
    </wsdl:eek:peration>
    </wsdl:portType>
    <wsdl:binding name="DAOServiceSoapBinding" type="impl:iDAO">
    <wsdlsoap:binding style="rpc"
    transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:eek:peration name="executeQuery">
    <wsdlsoap:eek:peration soapAction=""/>
    <wsdl:input name="executeQueryRequest">
    <wsdlsoap:body use="encoded"
    encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
    namespace="http://Interface.daopackage"/>
    </wsdl:input>
    <wsdl:eek:utput name="executeQueryResponse">
    <wsdlsoap:body use="encoded"
    encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
    namespace="http://Interface.daopackage"/>
    </wsdl:eek:utput>
    </wsdl:eek:peration>
    <wsdl:eek:peration name="executeUpdate">
    <wsdlsoap:eek:peration soapAction=""/>
    <wsdl:input name="executeUpdateRequest">
    <wsdlsoap:body use="encoded"
    encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
    namespace="http://Interface.daopackage"/>
    </wsdl:input>
    <wsdl:eek:utput name="executeUpdateResponse">
    <wsdlsoap:body use="encoded"
    encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
    namespace="http://Interface.daopackage"/>
    </wsdl:eek:utput>
    </wsdl:eek:peration>
    </wsdl:binding>
    <wsdl:service name="iDAOService">
    <wsdl:port name="DAOService"
    binding="impl:DAOServiceSoapBinding">
    <wsdlsoap:address
    location="http://thehost:8082/axis/services/DAOService"/>
    </wsdl:port>
    </wsdl:service>
    </wsdl:definitions>


    IDAO.java generated by running WSDL2Java using above WSDL.
    /**
    * IDAO.java
    *
    * This file was auto-generated from WSDL
    * by the Apache Axis WSDL2Java emitter.
    */

    package com.rf3labs.services.dbconn.dao.ws;

    public interface IDAO extends java.rmi.Remote {
    public java.lang.Object[] executeQuery(java.lang.String in0) throws
    java.rmi.RemoteException;
    public int executeUpdate(java.lang.String in0) throws
    java.rmi.RemoteException;
    }

    You will notice that the return type of executeQuery method is
    java.lang.Object[] rather than what was defined in iDAO.java interface
    which is java.util.List.






    wrote:
    > Hi,
    >
    > When I generate the classes using a WSDL I get a return type of
    > Object[] instead of the java.util.List object. From what I understand
    > List is serializable.
    > Any reason why it is changing the return type to Object[]?
    >
    > Thanks,
    >
    > -R
    , Dec 27, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Espen Dietrichs

    WebServices returning a java.util.Vector

    Espen Dietrichs, Aug 21, 2003, in forum: Java
    Replies:
    0
    Views:
    4,095
    Espen Dietrichs
    Aug 21, 2003
  2. Joey Vendetta
    Replies:
    0
    Views:
    3,435
    Joey Vendetta
    Apr 1, 2004
  3. Stefan
    Replies:
    0
    Views:
    722
    Stefan
    May 6, 2004
  4. Alexandra Stehman
    Replies:
    5
    Views:
    30,542
    Chris Smith
    Jun 17, 2004
  5. Replies:
    0
    Views:
    901
Loading...

Share This Page