public interface HelloWorldService {
@WebMethod
String sayHello(@WebParam(name = "name") String name);
}
@WebService(endpointInterface = "com.example.HelloWorldService")
public class HelloWorldServiceImpl implements HelloWorldService {
public String sayHello(String name) {
return "Hello, " + name + "!";
}
}
<servlet>
<servlet-name>XFireServlet</servlet-name>
<servlet-class>org.codehaus.xfire.transport.http.XFireServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/xfire.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<xfire:services>
<bean id="helloWorldService" class="com.example.HelloWorldServiceImpl"/>
</xfire:services>
@WebService
public class HelloWorldServiceImpl implements HelloWorldService {
// ...
}
<xfire:configurations enableGzipCompression="true" />