On Fri November 20 2009 4:38:14 pm Christian Schneider wrote:
> Often binding files are simply used to adjust things you want to have in
> all code generated from your wsdls. (Like mapping XmlGregorianCalendar
> to Date).
> Still the binding file must contain a wsdlLocation. So this makes it
> impossible to define one default binding file in the default options.
>
> So in the case of a default binding file I propose to write a copy of
> the binding file to the target directory and replace the wsdlLocation
> with the location of the wsdl file that is currently processed.
> Is this a good idea?
That's one possibility.
> Another solution would be to allow the wsdlLocation to be missing in the
> binding file and then internally resolve it to the wsdl file currently
> processed in the wsdl2java tool. This would be cleaner but I think this
> would be against the spec.
Yea, against spec. Section 8.4 specifically says it's mandatory for an
external binding file.
A couple options to think about:
1) Add an "-extensions" flag that enables some vendor extensions including
this. We can expand this in the future for more things. The wsimport tool
for the JAXWS-RI has this flag for this purpose as well.
2) Add a "new" flag for "special" binding file. Leave -b as is, but add a -B
for "default" binding that apply to everything. (wsdlLocation ignored)
I actually kind of like option 1.
--
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog
|