Deploying A web service

Mansour Al Akeel <[email protected]>
Newsgroups gmane.text.xml.axis.user
Message-ID <CAFvvX=b32dSjgeaMUga3gh_fjNsE=yvxmVJegMUzep9jK8m-zg@mail.gmail.com>
I am trying to deploy axis to an existing web application by
configuring axis2 servlet in my web.xml:

<servlet>
		<display-name>Apache-Axis Servlet</display-name>
		<servlet-name>AxisServlet</servlet-name>
		<servlet-class>org.apache.axis2.transport.http.AxisServlet</servlet-class>
		<load-on-startup>1</load-on-startup>
	</servlet>

	<servlet-mapping>
		<servlet-name>AxisServlet</servlet-name>
		<url-pattern>/soap/*</url-pattern>
	</servlet-mapping>


This page http://axis.apache.org/axis2/java/core/docs/servlet-transport.html
 handles cases where more that one protocol is used.
For now I am happy with HTTP, so I understand that no additional
configuration is required for axis2.xml
However I am getting this error:

org.apache.axis2.AxisFault: The service cannot be found for the
endpoint reference (EPR) /catalog/soap/Hello
        at org.apache.axis2.engine.DispatchPhase.checkPostConditions(DispatchPhase.java:78)
        at org.apache.axis2.engine.Phase.invoke(Phase.java:329)
        at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:262)
        at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:168)
        at org.apache.axis2.transport.http.util.RESTUtil.invokeAxisEngine(RESTUtil.java:144)
        at org.apache.axis2.transport.http.util.RESTUtil.processURLRequest(RESTUtil.java:139)
        at org.apache.axis2.transport.http.AxisServlet$RestRequestProcessor.processURLRequest(AxisServlet.java:837)
        at org.apache.axis2.transport.http.AxisServlet.doGet(AxisServlet.java:273)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
        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.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:722)

I understand that in axis2.war, services are deployed to
axis2/WEB-INF/services axis archives *.aar

However, I am looking to use  myWebApp/WEB-INF/classes directory to
expose my web services.
I like to use JAX-WS annotations and eliminate xml configurations if possible.


package com.example.webservices;

import javax.jws.WebMethod;
import javax.jws.WebService;

@WebService(name="Hello", serviceName="HelloService")
public class Hello {

	@WebMethod(action = "action:talk")
	public String talk() {
		return "Hello From Axi2 Web Service";
	}
}

My questions are,
1- is this error due to wrong configuration for axis2 or caused by
wrong deployment of the web service ? (or both) ?
2- Is there a way to avoid the extra packaging for the java code, and
just compile the WS into myApp/WEB-INF/classes and get axis2 to pick
it though annotations ?


Thank you in advance.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.