cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <>
Subject Re: Contributing to java2ws tool for maven
Date Mon, 26 Nov 2012 20:04:43 GMT

This is a relatively "complex" thing to do as it more or less would trace through a bunch
of things.   The main place you would need to look is in JAXBUtils.generateJaxbSchemas.  That
is where the schemas are "created".   It's done by calling into the JAXB context which then
generates the schemas.   We pass in a SchemaOutputResolver to create the DOMResult objects.
  For the most part, we just use the "suggested" name that JAXB provides.   However, that
method could be updated to allow passing some sort of Namespace -> Filename map or similar
that could be used.   We'd then need to trace the calls into there to provide enough hooks
for the java2ws to be able to pass that map in.  Patches would certainly be welcome.

That said, that would just solve the JAXB case.   If you need this for the other data bindings
(like Aegis), we'd have to look into each of those as well.


On Nov 24, 2012, at 12:11 PM, Cristiano Costantini <>

> Hello all,
> I'm in search for help to orient myself in the source code of the
> java2ws tool and most importantly on using it from maven.
> To study it, I've spent some time debugging the following projects:
> cxf-java2ws-plugin, cxf-tool-common, cxf-tool-java2ws and also
> cxf-codegen-plugin
> but when I get deep on the stack I get in classes which have limited
> comments and it is very hard to understand their behavior and how to
> eventually modify them respecting the application philosophy...
> I'm in search for some help, hints and guideline to try working on it
> and produce some patches, is there any expert who can give me some
> help and illuminate me on the tool architecture? It would be great the
> get in touch via some instant messaging application (irc or gtalk or
> anything else).
> Background:
> I work using the java first approach and writing classes annotated
> with jaxb it are our "modeling framework".
> This approach works good as the generated WSDL is natively friendly to
> Java, in the sense that the generated XML Schemas match Java classes
> and rules and we can avoid validation of input XML safely: for
> example, the schema will not have an <xsd:element minOccurs="5"
> maxOccurs="72" /> that require a validation step, I will only get
> <xsd:element minOccurs="0" maxOccurs="unbounded" /> from lists. This
> approach is developer friendly and I like it, and just dropping the
> Java classes into ObjectAid plugin for Eclipse and I get wonderful
> documentation.
> For generating the WSDL and the XSD schemas I use cxf-java2ws-plugin,
> however I have some limitations and I would like to improve the tool.
> The first big limit I have in cxf-java2ws-plugin, is that I cannot
> control the name of the xsd files generated from the the tool: when I
> use the maven-jaxb-schemagen-plugin, I can do this by using the
> following options:
> <schemas>
>  <schema>
>    <namespace></namespace>
>    <file>model.xsd</file>
>  </schema>
>  <schema>
>    <namespace></namespace>
>    <file>service.xsd</file>
>  </schema>
>  ...
> </schemas>
> and in  cxf-java2ws-plugin nothing similar is available.
> The second big limit I have, is that I need to generate multiple WSDLs
> files reusing the same XSDs, so I would need a tool which accepts
> multiple service endpoint's implementation (SEI) classes, and only
> generate one XSD file in case it is generate from the same annotated
> pojo. (Currently, I have multiple executions to generate these WSDLs,
> but in this way the same xsd is generated multiple for each SEI).
> thank you all, I hope I have not broken any rules of the mailing list
> (mail to and returned
> nothing), else please forgive me.
> Cristiano

Daniel Kulp -
Talend Community Coder -

View raw message