Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Hibernate + Axis2 automagically?  RSS feed

 
Philippe Desrosiers
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to develop some SOAP/WSDL web services (presumably using Axis2, although I'm open to alternatives) to provide secured access to an application database (through hibernate).

Here's the lowdown:

I've never used hibernate before, but I've gone through the quickstart, and created an ANT build script that can reverse-engineer my POJOs / Dao from the database information. So far so good.

I've also never used axis2 before, but figured out how to generate java wrappers for an existing SOAP service, from an exposed WSDL URI.

So I guess my question is, is there some facility in axis2, similar to wsdl2java, that I can use to create my web service modules automagically? Ideally I'd like to script the entire code-generation from within ANT, to minimize development time. Has anyone done this before, or can point me to some sample projects?

thanks,
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Philippe Desrosiers:
So I guess my question is, is there some facility in axis2, similar to wsdl2java, that I can use to create my web service modules automagically?


Existing POJOs can be exposed via java2wsdl - however that is usually a really bad idea. See Why Contract First? and this topic. Basically you need to spend some serious time deciding on the most effective way that you can expose your data (and functionality) to a client (hint: objects ain't it - look for a coarser grain that involves exchanging messages).

Axis2 supports the use of JiBX which lets you define the binding between your existing POJOs and existing XML Schemas (i.e. your message payloads).

And before you get too entranced with any more auto-magics ... usually you have to directly address the various "impedance mismatches" in a thoughtful manner.

Object Relational Impedance Mismatch
Relational/Object/XML (ROX) impedance mismatch.

Otherwise it becomes a matter "pay now or pay a lot more later". Some auto-magics are fantastic for proof-of-concepts and prototypes but some of them are too "seat-of-the-pants" for production software. I wouldn't be at all surprised if the Hibernate-generated database schema could not hold a candle to a properly designed one which could become a serious issue further down in the life-cycle of the solution.
[ November 18, 2008: Message edited by: Peer Reynders ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!