title: JAX-WS. SOAP response body <return> tag to custom tag
body: <p>I am receiving a deploy time error in Glassfish 4 when I try to deploy JAX-WS service with
  a @WebResult annotated method. Below are the artifacts.</p>
  
  <pre><code>@WebService(name = "TestMartCatalog", targetNamespace = "http://www.testmart.com")
  public interface ProductCatalogInterface {
  
      @WebMethod(action = "fetch_categories", operationName = "fetchCategories")
      public abstract List&lt;String&gt; getProductCatagories();
  
      @WebMethod
      public abstract List&lt;String&gt; getProducts(String category);
  
      @WebMethod
      public abstract boolean addProduct(String category, String product);
  
      @WebMethod
      @WebResult(name="Product")
      public abstract List&lt;Product&gt; getProductsv2(String category);
  
  }
  
  @WebService(endpointInterface="come.lets.learn.jaxws.ProductCatalogInterface",
          portName="TestMartCatalogPort", serviceName = "TestMartCatalogService")
  public class ProductCatalog implements ProductCatalogInterface {
  
      ProductServiceImpl prodImpl = new ProductServiceImpl();
  
      /* (non-Javadoc)
       * @see come.lets.learn.jaxws.ProductCatalogInterface#getProductCatagories()
       */
      @Override
      public List&lt;String&gt; getProductCatagories() {
          return prodImpl.getProductCatagories();
      }
  
      /* (non-Javadoc)
       * @see come.lets.learn.jaxws.ProductCatalogInterface#getProducts(java.lang.String)
       */
      @Override
      public List&lt;String&gt; getProducts(String category) {
          return prodImpl.getProducts(category);
      }
  
      /* (non-Javadoc)
       * @see come.lets.learn.jaxws.ProductCatalogInterface#addProduct(java.lang.String, java.lang.String)
       */
      @Override
      public boolean addProduct(String category, String product) {
          return prodImpl.addProduct(category, product);
      }
  
      /* (non-Javadoc)
       * @see come.lets.learn.jaxws.ProductCatalogInterface#getProductsv2(java.lang.String)
       */
      @Override
      public List&lt;Product&gt; getProductsv2(String category) {
          return prodImpl.getProductsv2(category);
      }
  
  }
  
  @XmlRootElement(name="Product")
  @XmlType(propOrder={"price", "sku", "name"})
  public class Product {
  
      private String name;
      private String sku;
      private double price;
  
      public Product() {
  
      }
  
      public Product(String name, String sku, double price) {
          this.name = name;
          this.sku = sku;
          this.price = price;
      }
  
      /**
       * @return the name
       */
      @XmlElement(name="ProductName")
      public String getName() {
          return name;
      }
  
      /**
       * @param name the name to set
       */
      public void setName(String name) {
          this.name = name;
      }
  
      /**
       * @return the sku
       */
      public String getSku() {
          return sku;
      }
  
      /**
       * @param sku the sku to set
       */
      public void setSku(String sku) {
          this.sku = sku;
      }
  
      /**
       * @return the price
       */
      public double getPrice() {
          return price;
      }
  
      /**
       * @param price the price to set
       */
      public void setPrice(double price) {
          this.price = price;
      }
  
  }
  </code></pre>
  
  <p>The exception stack trace at the time of deployment is as follows,</p>
  
  <blockquote>
    <p>2014-06-19T13:54:18.859+0530|WARNING: Deployment failed
    javax.xml.ws.WebServiceException: class
    come.lets.learn.jaxws.jaxws.GetProductsv2Response do not have a
    property of the name Product  at
    com.sun.xml.ws.server.sei.EndpointResponseMessageBuilder$DocLit.(EndpointResponseMessageBuilder.java:258)
      at
    com.sun.xml.ws.server.sei.TieHandler.createResponseMessageBuilder(TieHandler.java:212)
      at com.sun.xml.ws.server.sei.TieHandler.(TieHandler.java:117)
      at com.sun.xml.ws.db.DatabindingImpl.(DatabindingImpl.java:110)
    ........... Caused by: javax.xml.bind.JAXBException: Product is not a
    valid property on class
    come.lets.learn.jaxws.jaxws.GetProductsv2Response     at
    com.sun.xml.bind.v2.runtime.JAXBContextImpl.getElementPropertyAccessor(JAXBContextImpl.java:985)
      at
    com.sun.xml.ws.db.glassfish.JAXBRIContextWrapper.getElementPropertyAccessor(JAXBRIContextWrapper.java:120)
      at
    com.sun.xml.ws.server.sei.EndpointResponseMessageBuilder$DocLit.(EndpointResponseMessageBuilder.java:254)
      ... 61 more ............. 2014-06-19T13:54:18.890+0530|SEVERE:
    Exception during cleanup after start failed
    org.apache.catalina.LifecycleException: Manager has not yet been
    started   at
    org.apache.catalina.session.StandardManager.stop(StandardManager.java:934)
      at
    org.apache.catalina.core.StandardContext.stop(StandardContext.java:6099)
      at com.sun.enterprise.web.WebModule.stop(WebModule.java:720)
    .................. 2014-06-19T13:54:18.890+0530|SEVERE:
    ContainerBase.addChild: start: 
    org.apache.catalina.LifecycleException: java.lang.RuntimeException:
    Servlet web service endpoint '' failure   at
    org.apache.catalina.core.StandardContext.start(StandardContext.java:5920)
      at com.sun.enterprise.web.WebModule.start(WebModule.java:691)   at
    org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1041)
    ............ Caused by: java.lang.RuntimeException: Servlet web
    service endpoint '' failure   at
    org.glassfish.webservices.WSServletContextListener.contextInitialized(WSServletContextListener.java:109)
      at
    org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:5362)
    .................. Caused by: javax.xml.ws.WebServiceException: class
    come.lets.learn.jaxws.jaxws.GetProductsv2Response do not have a
    property of the name Product  at
    com.sun.xml.ws.server.sei.EndpointResponseMessageBuilder$DocLit.(EndpointResponseMessageBuilder.java:258)
      at
    com.sun.xml.ws.server.sei.TieHandler.createResponseMessageBuilder(TieHandler.java:212)
    ........... Caused by: javax.xml.bind.JAXBException: Product is not a
    valid property on class
    come.lets.learn.jaxws.jaxws.GetProductsv2Response     at
    com.sun.xml.bind.v2.runtime.JAXBContextImpl.getElementPropertyAccessor(JAXBContextImpl.java:985)
      at
    com.sun.xml.ws.db.glassfish.JAXBRIContextWrapper.getElementPropertyAccessor(JAXBRIContextWrapper.java:120)
    ............... 2014-06-19T13:54:18.890+0530|WARNING:
    java.lang.IllegalStateException: ContainerBase.addChild: start:
    org.apache.catalina.LifecycleException: java.lang.RuntimeException:
    Servlet web service endpoint '' failure
    java.lang.IllegalStateException: ContainerBase.addChild: start:
    org.apache.catalina.LifecycleException: java.lang.RuntimeException:
    Servlet web service endpoint '' failure   at
    org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1044)
      at
    org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:1024)
    ............. 2014-06-19T13:54:18.890+0530|SEVERE: Exception while
    invoking class com.sun.enterprise.web.WebApplication start method
    java.lang.Exception: java.lang.IllegalStateException:
    ContainerBase.addChild: start: org.apache.catalina.LifecycleException:
    java.lang.RuntimeException: Servlet web service endpoint '' failure
      at
    com.sun.enterprise.web.WebApplication.start(WebApplication.java:168)
      at org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)
      at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:291)
    ................... 2014-06-19T13:54:18.890+0530|SEVERE: Exception
    during lifecycle processing java.lang.Exception:
    java.lang.IllegalStateException: ContainerBase.addChild: start:
    org.apache.catalina.LifecycleException: java.lang.RuntimeException:
    Servlet web service endpoint '' failure   at
    com.sun.enterprise.web.WebApplication.start(WebApplication.java:168)
      at org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)
    ....................</p>
  </blockquote>