title: Generating Java from WSDL for use on Android with ksoap2-android SOAP client?
body: <p>I have to access a existing SOAP webservice from an Android application. I have been provided some WSDL files describing the webservice. Reading some <a href="https://stackoverflow.com/questions/297586/how-to-call-soap-web-service-with-android">other answers here on SO</a>, it seems <a href="http://code.google.com/p/ksoap2-android/" rel="noreferrer">ksoap2-android</a> is the way to go, with respect to which SOAP client to use.</p>
  
  <p>The next issue is then how to generate the Java classes needed from the WSDL files, and this is where I am coming up short. As far as I can see there are the following options:</p>
  
  <ol>
  <li><a href="http://axis.apache.org/axis2/java/core/tools/eclipse/wsdl2java-plugin.html" rel="noreferrer">AXIS2 code generator</a></li>
  <li><a href="http://code.google.com/p/wsdl2ksoap/" rel="noreferrer">WSDL2ksoap</a></li>
  <li><a href="http://docs.oracle.com/javase/6/docs/technotes/tools/share/wsimport.html" rel="noreferrer">JAX-WS wsimport tool</a></li>
  </ol>
  
  <p>I initially tried #1, with the AXIS2 eclipse plugin for wsdl2code generator. The wizard did successfully generate a lot of Java code, however it also changed my android project to some kind of webservice project, and I was never able to get anything that was generated to compile, let alone work with ksoap2-android. Has anybody has success with this?</p>
  
  <p>I am not able to run wsdl2ksoap successfully, as it seems to require a running webservice, and all I have at the current point in time is WSDL files. Likewise from reading the webpage, it seems to be a project in its initial stages, and not really ready for prime time.</p>
  
  <p>JAX-WS wsimport I have not had a chance to try yet. However I am unsure if what it generates will work with ksoap2-android?</p>
  
  <p><strong>Question: How can I generate Java files from WSDL files, for use on Android with ksoap2-android SOAP client library?</strong></p>
  
  <p>Thanks a lot in advance.</p>
  
  <p>(PS: Yes, the choice is SOAP, it is suboptimal for Android use, but I cannot change that.)</p>