Tuesday, December 25, 2007

Quick start for using JaxWS 2.1 / Metro 1.X with IntelliJ IDEA 7.0.2

Creating new Web Service with IntelliJ IDEA is easy:
  1. Create new Module, on page 'Select desired technologies' check Web Application / Web Services (by default JaxWS web service will be created).
  2. After finishing project first 'HelloWorld' web service is ready for launching (Run action in popup menu :).
  3. The webservice is published with URL 'http://localhost:9000/HelloWorld'
Consuming the Web Service is just as easy:
  1. Create new Module, on page 'Select desired technologies' check Web Service Client (by default JaxWS web service client will be created).
  2. In Web service url text field in appeared dialog enter http://localhost:9000/HelloWorld?wsdl
  3. In editor live template will guide sample code for web service invokation. After finishing it the web service client is ready for running.
By default web service / web service client is created with JaxWS 2.1 bundled with IntelliJ IDEA, if newer version JaxWS stack is needed (e.g. Metro 1.X) then specify its installation path in WebServices settings.

1 comment:

bohdan said...

When web module start to deploy i get such exceptions:
...
[2008-02-12 07:53:35,187] Facet Web: Module is being deployed, please wait...
07:53:36,343 INFO [TomcatDeployer] deploy, ctxPath=/Web, warUrl=.../tmp/deploy/tmp12423Web-exp.war/
07:53:36,359 ERROR [STDERR] Feb 12, 2008 7:53:36 AM com.sun.xml.rpc.server.http.JAXRPCServletDelegate destroy
INFO: JAXRPCSERVLET15: JAX-RPC servlet destroyed
07:53:36,375 ERROR [STDERR] Feb 12, 2008 7:53:36 AM com.sun.xml.rpc.server.http.JAXRPCContextListener contextDestroyed
INFO: JAXRPCSERVLET13: JAX-RPC context listener destroyed
07:53:38,296 ERROR [STDERR] Feb 12, 2008 7:53:38 AM com.sun.xml.ws.transport.http.servlet.WSServletContextListener contextInitialized
INFO: WSSERVLET12: JAX-WS context listener initializing
07:53:44,406 ERROR [STDERR] Feb 12, 2008 7:53:44 AM com.sun.xml.ws.transport.http.servlet.WSServletContextListener contextInitialized
SEVERE: WSSERVLET11: failed to parse runtime descriptor: com.sun.xml.ws.util.ServiceConfigurationError: com.sun.xml.ws.api.wsdl.writer.WSDLGeneratorExtension: Provider com.sun.xml.ws.policy.jaxws.PolicyWSDLGeneratorExtension could not be instantiated: java.lang.ClassCastException
com.sun.xml.ws.util.ServiceConfigurationError: com.sun.xml.ws.api.wsdl.writer.WSDLGeneratorExtension: Provider com.sun.xml.ws.policy.jaxws.PolicyWSDLGeneratorExtension could not be instantiated: java.lang.ClassCastException
at com.sun.xml.ws.util.ServiceFinder.fail(ServiceFinder.java:219)
at com.sun.xml.ws.util.ServiceFinder.access$300(ServiceFinder.java:127)
at com.sun.xml.ws.util.ServiceFinder$LazyIterator.next(ServiceFinder.java:363)
at com.sun.xml.ws.util.ServiceFinder.toArray(ServiceFinder.java:211)
...
Do you know what the problem is ?