I’ve a Spring-based web application and I need to expose a webservice using Axis. I followed this guide but service still doesn’t work properly. To resume, I have an EndPoint class like this:
package service;
import org.springframework.remoting.jaxrpc.ServletEndpointSupport;
public class SpringWSEndPoint extends ServletEndpointSupport implements ISpringWS {
private ISpringWS springWS;
protected void onInit() {
this.springWS = (ISpringWS) getWebApplicationContext().getBean("springWS");
}
public String sayHello(String message) {
return springWS.sayHello(message);
}
}
and servlet mapped like this:
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>WSSpring</display-name>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>axis</servlet-name>
<servlet-class>org.apache.axis.transport.http.AxisServlet</servlet-class>
<load-on-startup>5</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>axis</servlet-name>
<url-pattern>/axis/*</url-pattern>
</servlet-mapping>
</web-app>
Thus, once I navigate http://localhost:8080/myProject/axis/SpringWSEndPoint?wsdl it comes out with a (seems properly) auto-generated wsdl, as expected.
But if I go to http://localhost:8080/myProject/axis/SpringWSEndPoint/sayHello it doesn’t recognize it as a service method (“No service is available at this URL”)
I wonder I have to manually compile the webservice in any .war or .aar file in someway…
Thanks
(I’m running it in tomcat)
The service will accept POST requests to
http://localhost:8080/myProject/axis/SpringWSEndPoint, but not GET requests tohttp://localhost:8080/myProject/axis/SpringWSEndPoint/sayHello. Axis 1.x doesn’t support this request style. However, it supports something like this (for testing purposes):http://localhost:8080/myProject/axis/SpringWSEndPoint?method=sayHello&message=test.