This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Web Services and the fly likes JAXB binding files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "JAXB binding files" Watch "JAXB binding files" New topic

JAXB binding files

Greg Jewell

Joined: Mar 08, 2002
Posts: 10

I know this isn't strictly web service related, but this seems like the most appropriate forum since JAX-WS utilizes JAXB.

I am using JAXB to generate Java classes from a set of schemas that I have been given. The data types in these schemas reference each other frequently. Due to various reasons, I need to change the name of several fields in the generated code. To do this, I'm using bindings files to look for the nodes in question, and then to rename them in the Java code.

I'm running into issues, however, when a single schema may be processed by xjc multiple times. (As I mentioned, these schemas quite frequently reference each other.) Depending on the order that the schemas are processed, the Java code may be regenerated without the changed parameter names unless I duplicate all of the customization across all of the bindings files.

Is there any way to import/include one binding file in another? I want to do something like this:

I know that xjc allows any number of binding files to be specified, but I'm using ant to invoke the xjc task, and things get hairy when I have different numbers of bindings that are needed for different invocations.

I agree. Here's the link:
subject: JAXB binding files
Similar Threads
Top-Down approach: WSDL, JAX-WS and JAXB
Passing Set<java.lang.Object> and List<java.lang.Object> in Axis 2.0
JAXB - how to support extension via import
"Unsupported binding namespace "". Jaxb with ANT and external binding schema
XSD Compliance with WebService and JAXB