CXF-RS: Java Code Generation from xml/xsd

Cleaner approach is to use xjc like this:

Continue to dirty approach below if u need to:

When working with CXF-RS services often we start with XML message that will be served. After that we go through endless iteration of generating the right Java POJO's for the XML. The library like apache XMLBeans generate the Java code but the code generated is not what a developer would write and generally tedious to modify and understand.

I have come across a work around for generating Java classes from XSD (xml) which is very close to what a developer with decent experience will write. 

Follow the steps given below to explore the solution:
1. Generate the wsdl from from xsd as given in at this link (
2. The Java classes can be generated from wsdl from maven plugin entry below find complete details here


Hope this reduce your headache. Happy coding :)


Popular posts from this blog Connection reset

Spring: implements interface not working in @Controller

Hide empty last column from Table/Tree Viewer