title: Eclipse java JAX-RPC web service import generates an interface instead of a class
body: <p>therefore, when trying to instantiate an object of the class, the error is</p>
  
  <p><code>Cannot instantiate the type</code></p>
  
  <p><a href="https://i.stack.imgur.com/WEtHG.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WEtHG.jpg" alt="enter image description here"></a></p>
  
  <p>Does anyone know why Eclipse would generate an interface instead of a class? The web service was originally written in VB.Net but can be replicated following the simple example given <a href="https://blog.idrsolutions.com/2013/08/web-services-an-introduction/" rel="nofollow noreferrer">here</a></p>
  
  <ol>
  <li>Start an eclipse project.</li>
  <li>Add a new Web Service client <a href="http://www.webservicex.net/CurrencyConvertor.asmx?WSDL" rel="nofollow noreferrer">http://www.webservicex.net/CurrencyConvertor.asmx?WSDL</a></li>
  <li><p>Write the code...</p>
  
  <pre><code>package test;
  
  import NET.webserviceX.www.CurrencyConvertor; 
  import NET.webserviceX.www.CurrencyConvertorSoap; 
  import NET.webserviceX.www.Currency;
  
  public class Convert 
  {
      public static void main(String[] args) 
      {
          CurrencyConvertor cc = new CurrencyConvertor();
          // Gets an implementation of the interface we can use
          // to contact the web service.
          CurrencyConvertorSoap ccs = cc.getCurrencyConvertorSoap();
  
          // Send the SOAP request to the server and get the result from the web service
          double conversionRate = ccs.conversionRate(Currency.GBP, Currency.USD);
          System.out.println("£1 is worth $" + conversionRate );
      }
  }
  </code></pre></li>
  </ol>
  
  <p>What's happening is the CurrencyConverter.java is imported as an interface, so it can't be instantiated.</p>
  
  <p>It should be imported as a class. Why isn't it? </p>
  
  <p><a href="https://i.stack.imgur.com/xs7GG.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xs7GG.jpg" alt="enter image description here"></a></p>