I've tried that. The client gave me an error saying that "namespace=package"
is not a valid package.

I've also tried passing the schemaCompilerOptions inside the
createSchemaCompiler() method but then I ended up with
"com.sun.tools.xjc.BadCommandLineException: grammar is not specified". And
if I removed the grammar check I received some reflection related error.

I finally was able to solve my problem but not without altering CXF and
JAXBE source code. What I did was:

1. Added a setter method for the defaultPackage and packageLevelAnnotations
fields of the com.sun.tools.xjc.Options class.
2. Extend the Options interface defined in
org.apache.cxf.common.jaxb.JAXBUtils adding the setters described above.
3. Set the default package using the methods just after the SchemaCompiler
object is initialized in the
org.apache.cxf.endpoint.dynamic.DynamicClientFactory class.

As a suggestion for future releases I'd consider adding some additional
parameters for the DynamicClientFactory's createClient() method to be able
to provide compiller parameters as well as correcting some of the Options
default values.

It's ugly but it works.



--
View this message in context: 
http://cxf.547215.n5.nabble.com/Set-default-package-for-objects-generated-by-the-dynamic-client-tp5742640p5742651.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to