title: How does a wsimport generated client work?
body: <p>Before anything else, I want you to know that I can already connect to the web service server. I'm asking this question because I want to gain a deeper knowledge on how a wsimport generated client works. Based from my research, wsimport uses JAXWS. Please note that I have no knowledge from JAXWS.</p>
  
  <p>I generated my client using wsimport. The WSDL I used is from an Axis2 web service and was automatically generated by Axis2. The classes below are the results of wsimport:</p>
  
  <p>Under <code>com.datamodel.xsd</code></p>
  
  <ul>
  <li><code>DataBeanRequest.java</code></li>
  <li><code>DataBeanResponse.java</code></li>
  <li><code>ObjectFactory.java</code></li>
  <li><code>package-info.java</code></li>
  </ul>
  
  <p>Under <code>com.service</code></p>
  
  <ul>
  <li><code>MyWebService.java</code></li>
  <li><code>MyWebServicePortType.java</code></li>
  <li><code>MyMethod.java</code></li>
  <li><code>MyMethodResponse.java</code></li>
  <li><code>ObjectFactory.java</code></li>
  <li><code>package-info.java</code></li>
  </ul>
  
  <p>With the classes above, I can that tell that <code>com.datamodel.xsd</code> contains the beans used by the web service server (excluding <code>ObjectFactory</code> and <code>package-info</code>). Meanwhile, <code>MyMethod</code> and <code>MyMethodResponse</code> are also beans used to set the request and response parameter of the web service method/operation.</p>
  
  <p>Below are my questions: (You don't really have to answer all of it if you don't know the answers on some of my questions. :) And please feel free to share any info that you think I might find useful.)</p>
  
  <p>Am I correct with </p>
  
  <ul>
  <li>Am I correct with my assumptions above?</li>
  <li>What are the function of the other classes?</li>
  <li>I inspected <code>MyWebService</code> and it contains an annotation referring to the absolute location of the WSDL I used to generate the client. What is the relevance of specifying the <code>wsdllocation</code> in the client? How does the client use that info?</li>
  <li>I noticed that the actual URL of the web service is not declared in any of the classes generated. How does the client know where it needs to connect to?</li>
  <li>Was the WSDL file annotated so that the client can read the URL on the WSDL file upon connection? If so, then does it mean that the WSDL file is always read when a new connection must be established?</li>
  <li><strike>Since there's a need for me to compile my application and install it on a different server, the  will become invalid. Can I set it to a relative path instead of an absolute path? How? (Answer: Yes, it can be set to a relative path. The <code>wsimport</code> command has a <code>wsdllocation</code> attribute wherein the value of the <code>wsdllocation</code> can be specified.)</strike></li>
  <li>What if I need to connect to an HTTPS. How can I set the server certificate?</li>
  <li>Is there any difference when I generate my client using wsimport and when I generate it using Axis2 or Apache CXF.</li>
  </ul>