|
|
WS-Policy and the restFabian's Blog on WS-Policy and the rest |
|
Monday Jun 18, 2007
WSIT with a Java SE endpoint
The JAX-WS RI is supporting an Endpoint API that allows you to implement a web service just in plain Java without the need for a Servlet or EJB container. While we don't explicitly test WSIT with this API, it is still working just fine with it. You just need to take into account a few caveats. Here is some sample web service code. It does not differ in any way from any other JAX-WS web service: import javax.jws.WebService; Since you don't have a container, you will need to write a little bit of code to start a server that can host the web service. This code is ripped right off the Endpoint API documentation: import javax.xml.ws.Endpoint; You will still need to generate the portable artifacts of your web service before you run it. See the JAX-WS RI User Guide for details. So far all we have is an ordinary JAX-WS web service. If you are running Java 6, please remember that you need to put the API library into an endorsed directory, otherwise the JAX-WS 2.0 APIs included in Java 6 will override the JAX-WS 2.1 APIs that we require. Put webservices-api.jar into an endorsed directory if you are running Java 6. At runtime you will need webservices-rt.jar and webservices-extra.jar on the classpath and to generate the portable artifacts you need webservices-tools.jar. So, this was still all plain JAX-WS. All that you need to do to unleash WSIT is provide a configuration file and put it into the META-INF directory of your JAR (or if you have not jared up your code yet, put it in a META-INF directory on your classpath.) Writing a correct configuration file manually is an unpleasant task. I strongly recommend that you use NetBeans to generate one for you and then copy it into your project. The WSIT tutorial has extensive documentation on how to generate a configuration file. Technorati: WSIT Web Services Posted at 02:00PM Jun 18, 2007 by Fabian Ritzmann in Sun | Comments[2] |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Posted by Arun Gupta's Blog on June 19, 2007 at 03:29 AM EEST #
Posted by Arun Gupta's Blog on June 19, 2007 at 09:37 PM EEST #