permaculture playing cards
The moose likes Web Services and the fly likes Data Binding with Conf-File Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Data Binding with Conf-File" Watch "Data Binding with Conf-File" New topic

Data Binding with Conf-File

Daniel Pucher

Joined: Oct 07, 2008
Posts: 2
Here's the situation:

Im working on a server-side WebService with cxf. I have some Beans who are mapped via Annotations. For example:

And the Service has some function like getAttributeDefinition(). As you can see, i have some hardcoded code in the getters. That was for testing. Now im going to the next step, getting the data from a DB. Therefor I'm splitting the Server into two layers. 1. WebService and 2. DataAccess.

On the WebService-Side I have my beans who are like the one above, mapped with annotations. On the DataAccess side, I want to work with the same Objects, but using those from the WebService with the annotations doesn't sound like a good choice.

Therefor I want to mapp the beans with config files. So I can put the Beans on the DataAccess Layer, and when I'm using them in the Service, they are mapped via the Config-File. So no WebService related stuff on the DataAccess Layer.

And NOW we come to the Problem.
As I'm working with CXF there are particularly two options: JAXB and AEGIS.

=== 1 AEGIS ===
At first I had a look on aegis. Seems ok, so I went for a try:
I have a bean called ConfTest which I want to mapp (it has the attributes data1 and data2). Therefor I created a file called ConfTest.aegis.xml which looks like that and is stored next to the ConfTest.class file after compiling. Thats what the docu says. But it doesn't work. The attributes aren't mapped. Do I have to make some sort of configuration? (Haven't read anything about that in the documentation)

=== 2 JAXB ===
Atm I'm using JAXB-Annotations in my Beans, therefor a JAXB-Conf-File may be better, and I've had a look on the jaxb-docu, but I don'T get it...

Most important: Where do I have to put the Config-Files and what do I have to configure? Need some Guide-Links, but when I'm going to the official hp, theres only a "Unofficial JAXB Guide" which doesn't help too much...

I hope someone can help.
I agree. Here's the link:
subject: Data Binding with Conf-File
It's not a secret anymore!