users@jax-rpc.java.net

Re: How to create Serializer/Deserializer

From: Jan Tietjens <jantietjens_at_yahoo.com>
Date: Thu, 27 Feb 2003 02:25:24 -0700

Hello Suresh,
please see my comments bellow.

Suresh Yellamaraju wrote:

> Apologies. My mistake at not making it explicit.
>
> I am using DII approach, so I cannot use wscompile or other tools. I
> parse the given WSDL & get the info about ComplexType into the
> ArrayList. So, say the type is AComplexType. I put the name AComplexType
> into ArrayList along with the <element> info. I do not have the class,
> AComplexType.
>
> So should I write the serializer/deserializer?
Yes, I think in this case you need to write your own (de-)serializer. The JWSDP in the current version lacks support for complex data types. Hopefully this changes in the future!?!

Please refer to the JAX-RPC specification for more information about the serializer and deserializer framework. The document can be found at: http://java.sun.com/xml/downloads/jaxrpc.html.

I've all ready developed a framework which is capable to handle XML complex data types. Thus, I would recommend to study the source code from the UNO Web service proxy. It is open source, so feel free to use, modify, and enhance the code. Please send me feedback, questions or suggestions.

You could find the code at the following web page:
http://udk.openoffice.org/source/browse/udk/soap/proxy/src/

General informations are here:
http://udk.openoffice.org/java/examples/wsproxy/component_description.html

Interesting would be the following classes:

The ProxyFactory is the starting point. It triggers the parsing of the Web service description (WSD) in WSDL, the initializing of the (de-)serializers, it registers these (de-)serializers, etc.
com.sun.star.comp.webservice.unoproxy.ProxyFactory

The WSDLDocumentHandler parses the WSD.
com.sun.star.comp.webservice.unoproxy.WSDLDocumentHandler

You need to register your (de-)serializer at a TypeMapping, for this purpose you need to provide unique classes. These are created by the SimpleClassGenerator:
com.sun.star.comp.webservice.unoproxy.SimpleClassGenerator

Last but not least you need custom (de-)serializer:
com.sun.star.comp.webservice.unoproxy.GenericObjectSerializer

Another source for informations about the UNO Web Service Proxy is the mailing list dev_at_udk.openoffice.org.

I hope this helps,

regards
Jan