title: Web service client code compiler error in eclipse
body: <p>I have written the following three java files by following a book on javaEE with Glassfish. </p>
  
  <p>ClassValidator.java</p>
  
  <pre><code>import javax.jws.WebService;
  
  @WebService
  public class CardValidator {
      public boolean validate(CreditCard creditCard){
          Character lastDigit = creditCard.getNumber().charAt(creditCard.getNumber().length()-1);
          if(Integer.parseInt(lastDigit.toString())%2 != 0){
              return true;
          }
          else{
              return false;
          }
      }
  }
  </code></pre>
  
  <p>CreditCard.java</p>
  
  <pre><code>import javax.xml.bind.annotation.XmlRootElement;
  
  
  @XmlRootElement
  public class CreditCard {
      private String number;
      private String expiryDate;
      private Integer controlNumber;
      private String type;
      public String getNumber() {
          return number;
      }
      public void setNumber(String number) {
          this.number = number;
      }
      public String getExpiryDate() {
          return expiryDate;
      }
      public void setExpiryDate(String expiryDate) {
          this.expiryDate = expiryDate;
      }
      public Integer getControlNumber() {
          return controlNumber;
      }
      public void setControlNumber(Integer controlNumber) {
          this.controlNumber = controlNumber;
      }
      public String getType() {
          return type;
      }
      public void setType(String type) {
          this.type = type;
      }
  
  
  }
  </code></pre>
  
  <p>Main.Java</p>
  
  <pre><code>public class Main {
      public static void main(String[] args) {
  
      CreditCard creditCard = new CreditCard();
      creditCard.setNumber("12341234");
      creditCard.setExpiryDate("10/10");
      creditCard.setType("VISA");
      creditCard.setControlNumber(1234);
  
      CardValidator cardValidator = new CardValidatorService().getCardValidatorPort();
      cardValidator.validate(creditCard);
      }
  }
  </code></pre>
  
  <p>I am getting an error in Main.java at the line where the callValidatorService constructor is called(CardValidatorService cannot be resolved to a type). How to overcome this error? what other configurations should I make, to run this successfully? </p>