is it possible to deploy a webservice generated with Java 6 JAXWS under Tomcat? I can't find any information about this topic, besides a very old blog entry stating that I should checkout some jar from the glassfish nightly build - which doesn't seem like a very production stable option.
Any hints to documentation or a simple outline of the procedure would be welcome.
When that blog post was written, JAX-WS 2.0 was not yet released, so there was no released version to point to. By now it's final. Note that the 2.1 version was final, but has been temporarily withdrawn, so 2.0 is currently the version to use.
As an aside, I thought Java 6 includes JAS-WS 2.0, so maybe you already have everything you need?
Indeed I am talking about the Java 6 included JAXWS (whatever version that is) and my hope actually is that I have everything I need - only I do not know how to use it
I have written a class with annotations, used the wsgen tool shipped with my Java 6 SDK to generate WSDL and XSD files and then used the javax.xml.ws.Endpoint class to test the service. Everything works fine.
Now I am looking for a way to publish this web service via Tomcat ...
Section 3.1.2.3 of the User's Guide mentions creating a WAR file, so it looks as if the tools generate a regular web app, which should be deployable in Tomcat.
The WAR file created can now be published on a JAX-WS 2.0 SI enabled servlet container such as the Sun Java System Application Server Platform Edition 8.1
The war contains a sun-jaxws.xml descriptor that points the server to the webservice. Tomcat can do nothing with that, so I think I have to enable tomcat to be a "JAX-WS 2.0 SI enabled servlet container"? But how?
Or is there maybe another way to publish a Java6 webservice to tomcat (apart from using axis)?
I have found another source which explains the web.xml for such a war archive:
The following shows a web.xml file for a simple HelloWorld service. It specifies JAX-WS RI specific listener, servlet classes. These classes are com.sun.ws.transport.http.servlet.JAXRPCContextListener, and com.sun.xml.ws.transport.http.servlet.JAXRPCServlet is servlet
Only I can't find the mentioned classes neither in the Java 6 distribution nor in the jwsdp-2.0. However I found some classes in other packages that seem at least similar: com.sun.xml.rpc.server.http.JAXRPCServlet and com.sun.xml.ws.transport.http.servlet.WSServlet (and also corresponding listeners etc.).
So currently I'm trying to figure out what these classes do ... since there is no source code available this might be a bit tricky
Try configuring the com.sun.xml.ws.transport.http.servlet.WSServletContextListener class as a (surprise!) context listener. It accesses the /WEB-INF/sun-jaxws.xml file.
I found an article in the following Enterprise Java Technologies TECHNICAL TIPS Newsletter. This Tech Tip describes what you need to do to change a JAX-WS-based web service developed using Java WSDP 2.0 and deployed on the J2EE 1.4 platform so that it can be ported to the Java EE5 platform. I tried to deploy the webservice as described in the article to Java EE5 - but this doesn't work since Tomcat AFAIK isn't a Java EE5 compliant enterprise server.
However the text gives a hint that the J2EE 1.4 deployment method will work for tomcat:
JAX-WS technology was initially made available in the Java Web Services Developer Pack (Java WSDP) Version 2.0. This allowed early adopters to develop JAX-WS-based web services and deploy them on J2EE 1.4 implementations such as the J2EE 1.4 SDK (which includes the Sun Java System Application Server 8.2 Platform Edition) or Apache Tomcat.
So far I haven't managed to get the example running but I will keep trying
I think that may turn out to be dead end, as there is a special version of Tomcat (downloadable from java.sun.com somewhere) that has some extra tweaks that make it a J2EE server. But that's not the same thing as the standard Tomcat.
But the article specifically mentions which servlets and listeners to configure, and how they tie in with the sun-jaxws.xml file, so there's hope. Good find!
I do not exactly know how the JAX-WS RI 2.0 project is related to the JaxWS or Java6 or whatever ... Sun is very very confusing about this. All that OpenSource / Community / java.net / Glassfish ... I don't know what is the latest project and what is outdated
Useful content, Understanding web services is simpler than understanding the various techniques available to develop and deploy the web services...
Anyone aware of any comparisons of various web service development kit with advantages and disadvantages? I might be wrong, but why is it that java web service development is confusing for the beginner as its difficult to find one standard approach for the development
whether to use Axis, Java 6 JWS etc..