Java JAX-WS tutorial and standalone

If you’re wondering why I post this in English: I felt the urge to post in a way so Google & Co. can find it on the keywords I was unable to get any helpful results for.

In a homework we have to use JAX WS to implement a sample SOAP web service. I don’t understand why we were not simply allowed to continue using Axis (well, they said setting it up on server-side would be too complex – but if you’re just deploying the WAR archive and use the JWS approach without complex types/classes that would have been enough for such an exercise). It’s not only demanding you to use Java 1.6 (which Apple doesn’t think is worth providing a 32 Bit JRE/JDK for; so I can’t use my iBook to work on it) but compared to Axis I found JAX extremely bad documented (or their web site too confusing). I was unable to find the information I was looking for and got stuck on pages telling me how generated files look like after they have been generated. For some reason they just missed to give a fast introduction like “Getting started on implementing a web service” to give a short overview of what’s necessary just to get your workspace and environment up and running.

I thought I would need to setup Tomcat 6, compile, wsgen, write lots of configuration files, WAR everything and then deploy it. I was wrong. After hours of unsuccessful attempts and searches I remembered I saw something about JAX WS on IBM DeveloperWorks some time ago. I headed for their website and there it was: Design and develop JAX-WS 2.0 Web services describes everything you need to know to get started with JAX. It even shows a one-liner to start the web service standalone – without the hassle to deploy it. Just read until at least section 4 (page 8 on PDF) and have a look into the example code, class OrderWebServicePublisher. You’ll be surprised.

BTW: In case you are using Gentoo you may notice some JDK tools are not yet linked to /usr/bin (e.g. wsgen :P). You may want to have a look into /opt/sun-jdk-…/bin. Doesn’t affect the Ant task though.