JAX-WS is Bad, Bad!
I spent the day today researching Java Platform, Enterprise Edition 5 (JEE5) web services including the new Java API for XML Web Services 2.0 (JAX-WS), which is supposed to replace JAX-RPC. A while back I wrote that JAX-RPC is Bad, Bad, Bad! I gave a couple reasons of my own and also pointed to a paper from HP that clearly articulated JAX-RPC faults. JAX-WS 2.0 isn't much better, but to be fair I've given it only two Bads rather than three.
I spent 18 months writing a book on J2EE Web Services and when I was done I concluded that JAX-RPC was a grossly over engineered train wreck. The book I wrote was something short of 1,000 pages (Addison-Wesley reduced the font and changed the page layout to keep it below that threshold for marketing reasons). When I finished the book in 2004 I had made use of every fiber of that 1,000-page count and I still couldn't get into detail about everything. For example, the book was almost entirely a reference with only some tutorial aspects and very little in the way of architectural design. To me, if it takes 1,000 pages to write a reference book about a Java API, its likely that (a) the API is way to complex or (b) the writer sucks. I would prefer to blame the API. If I was to update the J2EE Web Services book for JEE5, it would probaby be longer than the first edition (no worries there; I have no intention of coughing up that hair-ball).
Sadly, I was little more impressed by JAX-WS 2.0, which is not as messy of a train wreck as JAX-RPC, but is still a train wreck. Yes, JAX-WS 2.0 does support annotations and they do cut down on the amount of XML configuration files you have to write, but even if you cut the XML required by JAX-RPC by 60% its still too much in my opinion. For the simplest web services (you know the ones that you'll never implement) JAX-RPC works fine, but once you get into more realistic scenarios the whole thing becomes an XML nightmare. JAX-WS 2.0 successfully reduces the configuration needed by introducing annotations with reasonable defaults, but it’s still a horribly complex technology. Again, really simple web services will probably be pretty easy to implement, but when it comes to supporting real-world scenarios it's going to get messy. Not only is the runtime behavior, including handler chains, still complicated but the number of annotations required could make source code (end-point interfaces or implementation classes) look like 20 kids tagged it with spray cans. It will be hard to see the code through all the annotations.
Doubt what I'm saying? Try to implement the eBay and Amazon.com web services with JAX-WS 2.0 – if it's really easy than show me and I'll eat my words. There you go JAX-WS 2.0 team: A challenge! You guys ought to be ashamed of yourselves. You could have taken this opportunity to re-engineer J2EE web services into something really simple, but you decided to put lipstick on the Pig instead.
NOTE: I recently posted my experiences trying to get JAX-WS to work against Amazon.com, Google, and eBay. The experience bears out my initial assessment that JAX-WS is a poor solution. See "Redeemed: JAX-WS still sucks!"