axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ben Souther" <bsout...@fwdco.com>
Subject BeanSerializer
Date Tue, 13 Aug 2002 13:38:03 GMT
Can anyone point me to an example of a Java client that calls a webservice who's return type
is a JavaBean?
I've looked at  samples/userguide/example5/BeanService.java. in the samples section of Axis.
This example demonstrates how to send a bean as an argument but doesn't show how to recieve
one as a returnType.


Here is my attempt:
 try{
            String  endpoint = "http://localhost:8080/axis/services/EmployerService";
            Service service  = new Service();
            System.out.println("service Created");
            
            Call  call = (Call)service.createCall();
            System.out.println("Call Created");
            
            call.setTargetEndpointAddress(new java.net.URL(endpoint));
            QName qn = new QName("EmployerService", "getEmployerData");
            call.setOperationName(qn);
            
            System.out.println("ready to invoke call....");
            
            EmployerBean employerBean = (EmployerBean)call.invoke(new Object[]{"1"});
            System.out.println("Call invoked...");
            
            if(employerBean == null)
                System.out.println("EmployerBean is null");
            
            String employerName = employerBean.getEmployerName();
            System.out.println("Name: " + employerName);
        }catch(Exception e){
            System.out.println("Error: " + e.toString());
        }
    }


Here is the error that I am fighting with:

- Exception:
org.xml.sax.SAXException: Deserializing parameter 'getEmployerDataReturn':  could not find
deserializer for type {com.fwdco.shared}EmployerBean
        at org.apache.axis.message.RPCHandler.onStartChild(RPCHandler.java:231)
        at org.apache.axis.encoding.DeserializationContextImpl.startElement(DeserializationContextImpl.java:857)
        at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:199)
        at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:644)
        at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:235)
        at org.apache.axis.message.RPCElement.getParams(RPCElement.java:259)
        at org.apache.axis.client.Call.invoke(Call.java:1806)
        at org.apache.axis.client.Call.invoke(Call.java:1711)
        at org.apache.axis.client.Call.invoke(Call.java:1251)
        at ReadEmployer.main(ReadEmployer.java:35)
Error: org.xml.sax.SAXException: Deserializing parameter 'getEmployerDataReturn':  could not
find deserializer for type {com.fwdco.shared}EmployerBean



Here is my WSDD.

I'm using Tomcat 4.0.3 


Thank you.



Mime
View raw message