You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Russell Butek <bu...@us.ibm.com> on 2002/05/03 20:48:32 UTC

Revamped WSDL2Java framework

Back before beta 2 I said I wanted to revamp the WSDL2Java framework for
better extensibility.  Well, here's my first stab at it:  (See attached
file: WSDL2.zip).  You should be able to plunk this into an existing build
and build it (at least it works for me).  Everything's new except some
tweaks I did to test/utils/TestSrcContext.java and
test/wsdl/Wsdl2javaAntTask.java that I had to make to get a build to use
this version of WSDL2Java rather than the original.

Those of you that might be interested (Tom, Rich, dims), please take a look
at this note and let me know if these changes are worthy to commit (and
where best to commit them).

I've rearranged things:
1.  org.apache.axis.wsdl2.st contains the symbol table classes
2.  org.apache.axis.wsdl2 contains the writer framework
3.  org.apache.axis.wsdl2.java contains the WSDL2Java extension to the
writer framework

I'm not particularly fond of these new package names or class names.  I
just wanted to put them somewhere without affecting the existing code.  The
important point is that there are 3 packages:  1 and 2 could conceivably be
pulled into a separate project.  3 is the only package that really must
stay inside AXIS.

Some notes.
- "java org.apache.axis.wsdl2.WSDL2 <wsdlFile>" will populate the symbol
table, doing any validation checks along the way.  It doesn't generate
anything.
- "java org.apache.axis.wsdl2.java.WSDL2Java <wsdlFile>" functions just
like org.apache.axis.wsdl.WSDL2Java.
- I got rid of Emitter.  That class had some stuff that belonged in the
framework and some stuff that belonged in the WSDL2Java extension.  The
hidden function moved into SymbolTable and the exposed stuff (option
accessors) moved to WSDL2 and its extension WSDL2java.
- WSDL2 is the parser front end framework.  WSDL2, Writer, and
WriterFactory are what extenders extend.
- There are still some Java-isms that I've got to remove from the
framework, but I managed to move most of them to the WSDL2Java package.
- A particularly handy hook for extending WSDL2Java is
JavaWriterFactory.addWriter(<WSDL type class>, <writer class>).  I like
that API, but I'm not sure about the best way to implement it (on
JavaWriterFactory or way back on WSDL2?), so right now the implementation
for it is just a hack to support my extension example (see next bullet).
I'd like to hear your thoughts on this.  I could leave it on
JavaWriterFactory, which means it's part of WSDL2Java extensions only.  Or
I could move it to WSDL2, which means ALL extensions (including WSDL2Java)
would use it.  A couple points about moving it to WSDL2:
1.  We could possibly get rid of the Java WSDL writers (JavaBindingWriter,
JavaServiceWriter, etc) and add the file writers directly.
2.  If we get rid of the intermediate writer classes, their logic would
have to move somewhere.  So the file writers would probably get more
complex.
- Here are a couple examples of extending WSDL2Java:  (See attached file:
examples.zip).  They both generate everything WSDL2Java does today, but
they also generate a file containing a list of service ports.  example1 is
an extension of the existing WSDL2Java.  example2 is an extension of my new
stuff.  You can see the new extension is about half the old one.  By the
class names you can see I intend to add some documentation to the
integration guide once I get the new implementation in place.

This whole thing deserves (and has from the beginning!) more description
than this little note, and it will get it (in the integration guide) once
we decide on the proper direction.  But for now, please ask me anything
that you're puzzled about.

Russell Butek
butek@us.ibm.com