axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Susan G. Conger" <cong...@yoeric.com>
Subject Error using call.invoke
Date Mon, 21 Mar 2005 05:11:46 GMT
I have a web service that has been deployed on an axis server.  The
deploy.wsdd is below:

<deployment xmlns="http://xml.apache.org/axis/wsdd/"
            xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">

 <service name="CookBooks" provider="java:RPC">
  <namespace>http://books</namespace>
  <parameter name="className" value="books.Books"/>
  <parameter name="allowedMethods" value="addBook listBooks"/>
  <parameter name="scope" value="Session"/>
     <operation name="addBook" qname="operNS:addBook"
xmlns:operNS="http://books" >
       <parameter name="in" type="tns:BooksInfo" xmlns:tns="http://books"/>
     </operation>
     
     <operation name="listBooks" qname="operNS:listBooks"
xmlns:operNS="http://books" returnQName="listBooksReturn"
returnType="rtns:ArrayOf_tns1_BooksInfo"
xmlns:rtns="http://localhost:8084/axis/services/CookBooks" >
     </operation>

     <typeMapping
       xmlns:ns="http://localhost:8084/axis/services/CookBooks"
       qname="ns:ArrayOf_tns1_BooksInfo" 
       type="java:books.BooksInfo[]"
       serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
       deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"
       encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
     />
     <typeMapping
       xmlns:ns="http://books"
       qname="ns:BooksInfo"
       type="java:books.BooksInfo"
       serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
       deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
       encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
     />

 </service>
</deployment>

When I run the following code I get an java.lang.InstantiationException:
books.Books

public class TestClient {
    
    public static void main(String [] args) {
        try {
            String endpoint =
"http://localhost:8084/axis/services/CookBooks";  
            Service service = new Service();
            Call call = (Call) service.createCall();
  
            call.setTargetEndpointAddress (new java.net.URL(endpoint));
            call.setOperationName (new QName
("http://soapinterop.org/CookBooks", 
                                   "listBooks"));
            BooksInfo[] bs = (BooksInfo[])call.invoke( new Object[] {} );
// List out the cook books
            System.out.println ("List of available COOK BOOKS");
            System.out.println ("============================");
        System.out.println ("");
        System.out.println ("");
        
        } catch (Exception e) {
            System.err.println(e.toString());
        }
    }


Anyone got any ideas?

Thanks,
Susan
======================================================================
Susan G. Conger                 Custom Windows & Macintosh Development
President                                Web Site Design & Development
YOERIC Corporation                       Database Design & Development
256 Windy Ridge Road
Chapel Hill, NC  27517
Phone/Fax: (919)542-0071
congers@yoeric.com
www.yoeric.com
 



Mime
View raw message