title: WSDL consume - What tool to use?
body: <p>I'm having trouble understanding how to make a web service client.
  The story is that I need to make a call to a web service. As I then understand it I need to somehow consume the web service to get the correct classes of the web service.</p>
  
  <p>I've investigated a numerous of ways to do this. For example I've tried consuming them with a script and then just import the classes.</p>
  
  <p>However, a colleague of my recommended that I would try using the Maven-plugin wsdl2code since we already use Maven-2 . Doing this works but creates a lot of junk files as I see it. I've added following into my pom.xml file:</p>
  
  <pre><code>&lt;plugin&gt;
      &lt;groupId&gt;org.apache.axis2&lt;/groupId&gt;
      &lt;artifactId&gt;axis2-wsdl2code-maven-plugin&lt;/artifactId&gt;
      &lt;version&gt;1.4&lt;/version&gt;
       &lt;executions&gt;
           &lt;execution&gt;
              &lt;goals&gt;
                  &lt;goal&gt;wsdl2code&lt;/goal&gt;
              &lt;/goals&gt;
              &lt;configuration&gt;
                  &lt;packageName&gt;ws.client.test&lt;/packageName&gt;
                  &lt;wsdlFile&gt;http://localhost:8088/test?WSDL&lt;/wsdlFile&gt;
                  &lt;databindingName&gt;xmlbeans&lt;/databindingName&gt;
                  &lt;outputDirectory&gt;target/ws/test&lt;/outputDirectory&gt;
              &lt;/configuration&gt;
           &lt;/execution&gt;
        &lt;/executions&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p>This creates the files successfully, but as said, there's also a lot of junk files(
  xmlsoap/schemas/soap/encoding/...) or at least a lot more files for no use (as I see it) than the other WSDLconsume I tried.</p>
  
  <p><strong>Questions</strong>   </p>
  
  <ul>
  <li><p>Is there a general guidelines how to
  consume a web service? Since the WSDL
  file is external it could also be
  changing, and therefor I thought
  it could be good having this done
  automatically in Maven (though there
  would be other side effects if the
  WSDL suddenly changed...).</p></li>
  <li><p>If the wsdl2code is a good choice, should all the files always be created in the target-catalouge so<br>
  that they are being removed when executing mvn clean)?</p></li>
  <li><p>Is there any other tool that might fit better?</p></li>
  </ul>
  
  <p><strong>Update/Edit</strong><br>
  By using for example JAX-WS wsimport I get the generated files that I desire. 
  However, by having these created in the /target-folder I want to reach them in the same project to actually call the web service. Is this possible? </p>