title: How to change the 'webservices' path generated by @WebService on TomEE
body: <p>I'm learning the ropes of annotating my classes with @WebService I noticed that when I deploy to TomEE-plus (v1.6) I get an additional 'webservices' word in the url.</p>
  
  <p>I want to either remove it or rename it if possible.</p>
  
  <p>Given this code for an Eclipse project named WebAPI-DEV:</p>
  
  <pre><code>import java.util.List;
  import javax.ejb.Stateless;
  import javax.jws.WebService;
  
  @Stateless
  @WebService
  public class WEBAPIImplementation {
      public List&lt;Client&gt; getClientsByTerm(String term) {
          return null;
      }
  }
  </code></pre>
  
  <p>I find on the catalina log the following:</p>
  
  <pre><code>Dec 10, 2013 3:49:05 PM org.apache.openejb.server.webservices.WsService deployApp
  INFO: Webservice(wsdl=http://mylocalhost.com:8080/WebAPI-DEV/webservices/WEBAPIImplementation, qname={http://mylocalhost.com:8080/webapi}WEBAPIImplementationService) --&gt; Ejb(id=WEBAPIImplementation)
  </code></pre>
  
  <p>The url <code>http://mylocalhost.com:8080/WebAPI-DEV/webservices/WEBAPIImplementation</code> has 'webservices' included. </p>
  
  <p>I would rather have more control on defining the exact name of my webservice url. </p>
  
  <p>Is that possible?</p>
  
  <p><strong>UPDATE (2013-DEC-16):</strong>
  I followed the simple tutorial from </p>
  
  <blockquote>
    <p><a href="http://blog.sortedset.com/step-by-step-web-services-with-tomcat-tomee-apache-cxf-eclipse/" rel="nofollow noreferrer">http://blog.sortedset.com/step-by-step-web-services-with-tomcat-tomee-apache-cxf-eclipse/</a></p>
  </blockquote>
  
  <p>Basically the parameters in the @Webservice annotation cause errors like this:</p>
  
  <pre><code>org.apache.openejb.config.ValidationFailedException: Module failed validation. AppModule(name=TEST-WS)
  </code></pre>
  
  <p>and...</p>
  
  <pre><code>org.apache.catalina.LifecycleException: An invalid Lifecycle transition was attempted ([before_destroy]) for component [StandardEngine[Catalina].StandardHost[mylocalhost.com].StandardContext[/TEST-WS]] in state [STARTING_PREP]
  </code></pre>
  
  <p>and...</p>
  
  <pre><code>SEVERE: Error deploying web application archive C:\apache-tomee-plus-1.6.0\webapps\TEST-WS.war
  java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[mylocalhost.com].StandardContext[/TEST-WS]]
  </code></pre>
  
  <p>Originally I had these parameters for @Webservice <code>(replace sortedset.com for localhost):</code></p>
  
  <pre><code>@WebService(
          portName = "HelloTomEEPort",
          serviceName = "HelloTomEEService",
          targetNamespace = "http://localhost/wsdl",
          endpointInterface = "HelloTomEEWs")
  </code></pre>
  
  <p>Here are my two source files (I started a new project from scratch):</p>
  
  <p><strong>TESTWS.java</strong></p>
  
  <pre><code>import javax.jws.WebService;
  @WebService
  public interface TESTWS {    
      public int sum(int add1, int add2); 
      public int multiply(int mul1, int mul2);
  }
  </code></pre>
  
  <p><strong>TESTWSImpl.java</strong></p>
  
  <pre><code>import javax.ejb.Stateless;
  import javax.jws.WebService;
  @Stateless
  @WebService
  public class TESTWSImpl implements TESTWS { 
      public int sum(int add1, int add2) {
          return add1 + add2;
      } 
      public int multiply(int mul1, int mul2) {
          return mul1 * mul2;
      }
  }
  </code></pre>
  
  <p>This code allows TomEE to startup but when I request the url (as found in the catalina.log):</p>
  
  <blockquote>
    <p><a href="http://mylocalhost.com:8080/TEST-WS/webservices/TESTWSImpl" rel="nofollow noreferrer">http://mylocalhost.com:8080/TEST-WS/webservices/TESTWSImpl</a></p>
  </blockquote>
  
  <p>I get this error:</p>
  
  <pre><code>Dec 16, 2013 5:21:57 PM org.apache.cxf.phase.PhaseInterceptorChain doDefaultLogging
  WARNING: Interceptor for {http://mylocalhost.com/wsdl}TESTWSImplService has thrown exception, unwinding now
  org.apache.cxf.interceptor.Fault: No such operation: TEST-WS (HTTP GET PATH_INFO: /TEST-WS/webservices/TESTWSImplnull)
      at org.apache.cxf.interceptor.URIMappingInterceptor.handleMessage(URIMappingInterceptor.java:93)
      at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
      at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
      at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:237)
      at org.apache.openejb.server.cxf.CxfWsContainer.onMessage(CxfWsContainer.java:85)
      at org.apache.openejb.server.webservices.WsServlet.service(WsServlet.java:98)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
      at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:45)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
      at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
      at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603)
      at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)
  </code></pre>
  
  <p>What causes the "No such operation"?</p>
  
  <p>Where can I find good documentation for the parameters of @Webservice?</p>
  
  <p><strong>NOTE:</strong> Replace mylocalhost.com with localhost</p>
  
  <p><strong>UPDATE (2013-DEC-17):</strong>
  I was calling the webservice incorrectly, the proper url should be:</p>
  
  <blockquote>
    <p><a href="http://mylocalhost.com:8080/TEST-WS/webservices/TESTWSImpl?wsdl" rel="nofollow noreferrer">http://mylocalhost.com:8080/TEST-WS/webservices/TESTWSImpl?wsdl</a></p>
  </blockquote>
  
  <p>Referenced at </p>
  
  <blockquote>
    <p><a href="https://stackoverflow.com/questions/11854286/simple-webservice-example-tomee-not-working">Simple webservice example tomEE not working</a></p>
  </blockquote>
  
  <p>I guess I will learn to live with this generated url path ('webservices') until I understand more of how to configure it.</p>
  
  <p><strong>UPDATE (2014-JAN-20):</strong>
  I completed one approach with <code>Enpoint.publish</code> and added it as an answer.</p>