Hi,

If java.lang namespaces located in schemas, you should be able to resolve that 
using JAXB binding: 

http://docs.oracle.com/cd/E17802_01/webservices/webservices/docs/2.0/tutorial/doc/JAXBUsing4.html
http://stackoverflow.com/questions/8313122/change-package-of-generated-jaxb-class

CXF xjc has an option to specify JAXB custom binding (bindingFile).

Regards,
Andrei.

> -----Original Message-----
> From: akaine [mailto:[email protected]]
> Sent: Donnerstag, 10. April 2014 00:54
> To: [email protected]
> Subject: Re: Set default package for objects generated by the dynamic client
> 
> 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