Nelson,
yes, it's not cached. no specific reason for not doing it :) Yes, this code should
work
-- dims
--- Nelson Minar <[EMAIL PROTECTED]> wrote:
> I've been experimenting with overriding the WSDL that Axis provides in
> a dynamic fashion. Doing more than just substituting a static file.
> Following a tip from Tom J I've been doing this via Hander.generateWSDL().
> I've learned that WSDL generation happens in
> org.apache.axis.providers.BasicProvider.generateWSDL()
>
> What surprises me is that the work this method does doesn't seem to be
> cached at all. I'd naively assumed the bytes for the WSDL would be
> generated once, but instead it looks like a new DOM tree is built
> everytime the WSDL is created. Is that on purpose, or is this just an
> optimization that's not yet done?
>
>
> I thought I'd also share my code for intercepting the WSDL. The
> approach here is to get Axis to generate the WSDL, then capture it and
> modify the DOM once you have it. Warning: I haven't actually modified
> anything here, but I think it will work :-)
>
> This code belongs in a Handler in the requestFlow.
>
> /** Handler to override Axis' default WSDL generation, intercepting
> ** the DOM and modifying it how we want.
> **/
> public void generateWSDL(MessageContext ctx) throws AxisFault {
> log.info("Generate WSDL called");
>
> if (ctx.getProperty("WSDL") == null) {
> log.info("No WSDL was set up yet, hacking it in");
> // This method invocation induces Axis to create a WSDL DOM and
> // put it into the message context
> new RPCProvider().generateWSDL(ctx);
> }
> Document wsdl = (Document)ctx.getProperty("WSDL");
> log.info("Found some WSDL, here's a dump of it:");
> log.info(XMLUtils.PrettyDocumentToString((Document)wsdl));
> // We could modify the wsdl DOM now.
> }
=====
Davanum Srinivas - http://webservices.apache.org/~dims/