title: JAX-WS Exception - "return is not a valid property"
body: <p>I am new to JAX-WS, when I try to start this simple Web Service:</p>
  
  <p>Interface:</p>
  
  <pre><code>package ws;
  
  import java.util.HashMap;
  import javax.jws.WebMethod;
  import javax.jws.WebService;
  
  @WebService
  public interface IBasket {
      @WebMethod public abstract void addItem(int productId, int count);  
      @WebMethod public abstract HashMap&lt;Integer, Integer&gt; getBasketMap();
  }
  </code></pre>
  
  <p>Implementing Class:</p>
  
  <pre><code>package model;
  
  import java.util.HashMap;
  import javax.jws.WebService;
  import ws.IBasket;
  
  @WebService(endpointInterface = "ws.IBasket")
  public class Basket implements IBasket {
  
      private HashMap&lt;Integer, Integer&gt; basket;
  
      public Basket() {
          this.basket = new HashMap&lt;Integer, Integer&gt;();
      }
  
      @Override
      public void addItem(int productId, int count) {
          int currentCount = 0;
          if (basket.containsKey(productId)) {
              currentCount = basket.get(productId);
          }
          basket.put(productId, currentCount + count);
      }
  
      @Override
      public HashMap&lt;Integer, Integer&gt; getBasketMap() {
          return basket;
      }
  }
  </code></pre>
  
  <p>Publisher:</p>
  
  <pre><code>package endpoint;
  
  import javax.xml.ws.Endpoint;
  import model.Basket;
  
  public class WSPublisher {
  
      public static void main(String[] args) {
          Endpoint.publish("http://localhost:8080/WS/Basket",new Basket());
      }
  }
  </code></pre>
  
  <p>I'm getting the following stacktrace:</p>
  
  <pre><code>Exception in thread "main" javax.xml.ws.WebServiceException: class ws.jaxws.GetBasketMapResponse do not have a property of the name return
      at com.sun.xml.internal.ws.server.sei.EndpointResponseMessageBuilder$DocLit.&lt;init&gt;(EndpointResponseMessageBuilder.java:196)
      at com.sun.xml.internal.ws.server.sei.EndpointMethodHandler.createResponseMessageBuilder(EndpointMethodHandler.java:191)
      at com.sun.xml.internal.ws.server.sei.EndpointMethodHandler.&lt;init&gt;(EndpointMethodHandler.java:97)
      at com.sun.xml.internal.ws.server.sei.SEIInvokerTube.&lt;init&gt;(SEIInvokerTube.java:72)
      at com.sun.xml.internal.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:208)
      at com.sun.xml.internal.ws.api.server.WSEndpoint.create(WSEndpoint.java:498)
      at com.sun.xml.internal.ws.transport.http.server.EndpointImpl.createEndpoint(EndpointImpl.java:246)
      at com.sun.xml.internal.ws.transport.http.server.EndpointImpl.publish(EndpointImpl.java:170)
      at com.sun.xml.internal.ws.spi.ProviderImpl.createAndPublishEndpoint(ProviderImpl.java:113)
      at javax.xml.ws.Endpoint.publish(Endpoint.java:240)
      at endpoint.WSPublisher.main(WSPublisher.java:14)
  Caused by: javax.xml.bind.JAXBException: return is not a valid property on class ws.jaxws.GetBasketMapResponse
      at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getElementPropertyAccessor(JAXBContextImpl.java:966)
      at com.sun.xml.internal.ws.server.sei.EndpointResponseMessageBuilder$DocLit.&lt;init&gt;(EndpointResponseMessageBuilder.java:193)
      ... 10 more
  </code></pre>
  
  <p>Any ideas how to solve this?</p>