axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Johnson <>
Subject Re: [axis2] "simple" axis data binding architecture and approach for rpc support
Date Wed, 12 Oct 2005 21:03:49 GMT
Sanjiva Weerawarana wrote:

>Hi Guys,
>I volunteered to write up the current design being implemented for the
>"simple" Axis data binding and for supporting RPC. This design is a bit
>different from the Axis1 design of data binding (I think) .. hopefully
>its an improvement and not a regression!
>Axis Data Binding
>The objective is to provide a tool that supports a minimal subset of XML
>Schema and generates Java data bindings for them. The definition of
>where "minimal" ends is currently under debate of course; we have to all
>come to some consensus on where to draw that line.
>The tool augments the WSDL2Code tool by becoming a pluggable data binder
>to generate data bound parameters instead of OMElement parameters.
>Note that this step does not extend the support for RPC style WSDLs yet;
>WSDL2Code only supports doc/lit stuff so far.
>To avoid generating lots of extra classes, the current plan is to put
>into each generated ADB class a static read() and a non-static write()
>method. Each generated class implements the following interface so that
>we can detect when these will be present:
>public interface ADBBean {
>    /**
>     * This method is used to serialize an ADBBean: get the pull parser
>     * and pull the XML pull events to represent the bean.
>     * 
>     * @param adbBeanQName
>     *            the name of the element to be generated for this
>     *            ADBBean
>     * @return a pull parser for this ADBBean.
>     */
>    public XMLStreamReader getPullParser(QName adbBeanQName);
This strikes me as odd.  Two issues here.  One - the bean is acting as a 
"factory" of sorts for a pull parser, and two, wouldn't it be clearer to 
simply have the bean write its output using an XMLStreamWriter?  That 
would allow the bean implementation much more flexibility in how it is 
implemented.  So I would suggest the following instead:

public XMLStreamWriter writeToXml(QName beanName);

This makes your sample below a little trickier. Instead of:

Person p = new Person();
p.set* ();
Person pcopy = (p.getPullParser(new QName ("myPerson")));
assert pcopy.equals (p);

You'd have to do:

Person p = new Person();
p.set* ();
Person pcopy = (ADBUtils.createReaderFromWriter(p.writeToXml( new QName ("myPerson"),
new ImplOfXmlStreamWriter() ) );
assert pcopy.equals (p);

Of course, this isn't quite as simple, but it is close.

>Supporting RPC Style WSDLs
I confess I've not spent enough time to consider this part of the 


View raw message