axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Poulsen <>
Subject RE: Question on DII and deserialize
Date Thu, 22 May 2003 14:00:07 GMT
You will probably have to generate a java class from the WSDL description of
the Web Service, and then look at that java class to determine whether or
not it conforms to the java bean specification.

If it does, you can probably use the built in bean deserializer for your
purposes, but you will have to explicitly register the GoogleSearchResult
type with the built in bean deserializer with your Call instance prior to
calling the 'invoke' method.

-----Original Message-----
From: Yang Liu []
Sent: Tuesday, April 22, 2003 7:41 AM
Subject: Question on DII and deserialize

I am new to axis and trying to use axis as the client side DII engine.
I played axis for a whole day, but still can't figure out how to do 
certain things, someone please help to see whether I am still on the 
correct road.

When calling webservices with only simple type, everything works fine. 
Then I tried to use DII to call GoogleSearch, my program is very simple:

public class TestGoogleSearch {
     public static void main(String[] args) throws Exception {
         ServiceFactory serviceFac = ServiceFactory.newInstance();
         Service s = serviceFac.createService(new
             new QName("urn:GoogleSearch", "GoogleSearchService"));
         Call c = s.createCall(new QName("urn:GoogleSearch",
             new QName("urn:GoogleSearch", "doGoogleSearch"));
         Object ret = c.invoke(
             new Object[]{"i6Cu0fZQFHILEiqcBJDXAshfuTxmjN7r",
                 "axis", new Integer(1), new Integer(10),
                 Boolean.FALSE, "", Boolean.TRUE, "", "", ""

Then get exception as:

- Exception:
org.xml.sax.SAXException: Deserializing parameter 'return':  could not 
find deserializer for type {urn:GoogleSearch}GoogleSearchResult
	at org.apache.axis.message.RPCElement.getParams(
	at org.apache.axis.client.Call.invoke(
	at org.apache.axis.client.Call.invoke(
	at org.apache.axis.client.Call.invoke(
	at com.voxa.test.TestGoogleSearch.main(

I understand that axis tries to find a deserializer to deserialize the 
response into a java object. But I only need axis to return me an 
object, that it can be a dom element or SOAPElement, whatever. I only 
need to be able to access the information in the returned object.

So I guess I need register some special deserializer, and I don't know 
where to begin. The javax.xml.rpc package has some TypeMapping interface 
and deserializer interface, but with little documentation. I read some 
of axis code, guess that I should implement a DeserializerImpl, and do 
my own stuff.

Am I on the correct road? Is there an existing deserializer doing the 
same stuff? If I want to use this approach, do I need to register a 
deserializer for each XML type I met? Is there a way I register once 
then handle all those complex XML type (but still let axis handle simple 

Thanks in advance.


View raw message