title: Use Maven to trigger a wsgen & wsimport in a row, using wsdlLocation
body: <p>I have hard times using maven to generate my web service client. So please refer to <a href="https://stackoverflow.com/questions/2131001/creating-a-web-service-client-directly-from-the-source">Creating a web-service client directly from the source</a> for the first part of my question.</p>
  <p>To keep it simple and short, I want to go from here (a file in src/main/java) :</p>
  <pre><code>package com.example.maven.jaxws.helloservice;
     
  import javax.jws.WebService;
  
  @WebService
  public class Hello {
       public String sayHello(String param) {
           return &quot;Hello &quot; + param;
       }
  } 
  </code></pre>
  <p>to there :</p>
  <pre><code>/**
   * This class was generated by the JAX-WS RI.
   * JAX-WS RI 2.1.7-b01-
   * Generated source version: 2.1
   * 
   */
  @WebServiceClient(name = &quot;HelloService&quot;, targetNamespace = &quot;http://helloservice.jaxws.maven.example.com/&quot;, wsdlLocation = &quot;http://localhost:8080/test/&quot;)
  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
  </code></pre>
  <p>using only 1 pom.xml file.</p>
  <p>Please note the wsdlLocation set on the end.
  The pom.xml file will probably use both maven-jaxws-plugin <code>wsgen</code> AND <code>wsimport</code> with some tricky configuration to achieve this.</p>