Sunday, 8 February 2015

How do I annotate Grails domain classes with JAXB?



I'm embedding Apache CXF in my Grails Web app so I can expose services via SOAP. I'm not very familiar with the framework yet but I think for it to be able to use any POJO/POGO as result and/or parameter, they have to be annotated with JAXB. I've created a demo service that kind of confirms that to me. I also got some information from this StackOverflow question about getting Groovy and JAXB to play nice. Now, my problem in particular is about annotating associations in Grails domain classes. How do I do that?


In the case it's not possible, I'm thinking about just creating some sort of corresponding DTOs for each domain class my SOAP services need. It probably isn't the best practice, but it doesn't seem so bad... does it?


No comments:

Post a Comment