Use Maven to trigger a wsgen & wsimport in a row, using wsdlLocation

Posted by ben on Stack Overflow See other posts from Stack Overflow or by ben
Published on 2010-01-28T21:39:17Z Indexed on 2010/05/16 2:00 UTC
Read the original article Hit count: 501

Filed under:
|
|

I have hard times using maven to generate my client. So Please refer to http://stackoverflow.com/questions/2131001/creating-a-web-service-client-directly-from-the-source for the first part of my question.

To keep it simple and short, I want to go from here (a file in src/main/java) :

   package com.example.maven.jaxws.helloservice;
   import javax.jws.WebService;
   @WebService
   public class Hello {
     public String sayHello(String param) {
     ;  return "Hello " + param;
     }
   } 

to there :

/**
 * This class was generated by the JAX-WS RI.
 * JAX-WS RI 2.1.7-b01-
 * Generated source version: 2.1
 * 
 */
@WebServiceClient(name = "HelloService", targetNamespace = "http://helloservice.jaxws.maven.example.com/", wsdlLocation = "http://localhost:8080/test/")
public class HelloService
    extends Service
{

    private final static URL HELLOSERVICE_WSDL_LOCATION;
    private final static Logger logger = Logger.getLogger(com.example.wsimport.HelloService.class.getName());
    ...etc

using only 1 pom.xml file.

Please note the wsdlLocation set on the end. The pom.xml file will probably use both maven-jaxws-plugin wsgen AND wsimport with some tricky configuration to achieve this.

© Stack Overflow or respective owner

Related posts about jax-ws

Related posts about maven-2