• Post Reply Bookmark Topic Watch Topic
  • New Topic

Data Binding with Conf-File  RSS feed

Daniel Pucher
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!