axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Glen Daniels <gdani...@macromedia.com>
Subject RE: WSDL generation tools
Date Tue, 22 Jan 2002 15:25:21 GMT

Hi Byrne!

> For example, I would love to be able to intercept requests for
> '/axis/service?MY_WSDL' and return in the response a slight 
> modification
> to the default Axis Java2WSDL translation. Does the Axis framework at
> this point support such functionality?

Yes.  The way the WSDL generation works is very much like a standard invocation of Handlers
in the standard order (transport->global->service->global->transport), except
that instead of calling invoke(MessageContext) on each Handler, generateWSDL(MessageContext)
is called instead.  This allows Handlers to put extra information, such as header descriptions,
into the WSDL.

The actual code to introspect a Java class for a service and turn it into WSDL can be found
in the JavaProvider class.  This means that by the time the provider returns from generateWSDL(),
there should be a WSDL document in the "WSDL" property in the MessageContext (see AxisServlet's
doGet() for an example of how this gets accessed).

So your best bet is probably to define a Handler which implements generateWSDL() and deploy
it on the response side of your service (or even in the global response chain if appropriate
for your application).  That Handler can grab the WSDL from the MC, edit it, and then put
it back.

<*** ATTN COMMITTERS! ***>
Actually, this brings up an issue with the way the current code is structured.  As it stands,
the WSDL is returned as a DOM Document in the MessageContext.  I'm thinking we might consider
directly returning a javax.wsdl.Definition instead, and letting the AxisServlet (or whoever
else wants it as XML) serialize it into XML.  This would allow use cases like yours to more
easily manipulate the object structure of the WSDL, rather than having to translate it back
and forth between WSDL4J and DOM multiple times....  What do other Axis developers think?
</*** ATTN COMMITTERS! ***>

> I would love to get involved and experiment in ways to make such
> functionality possible, but I don't want to be reinvent'n the wheel as
> it were.

Go for it!  We're very psyched when people use the engine in new and interesting ways - please
keep us posted as to your progress.

--Glen

Mime
View raw message