SimpleWsService.java
package com.training.ws;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
@WebService
public interface SimpleWsService {
@WebMethod(action = "getServiceNameAction", operationName = "getServiceName", exclude = false)
String getServiceName();
@WebMethod(action = "helloAction", operationName = "hello", exclude = false)
String hello(@WebParam(name = "nameParam") String name);
}
SimpleWsServiceImpl.java
package com.training.ws;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
@WebService(endpointInterface = "com.training.ws.SimpleWsService", serviceName = "SimpleWsService")
public class SimpleWsServiceImpl implements SimpleWsService {
@Override
public String getServiceName() {
return "SimpleWsService";
}
@Override
public String hello(@WebParam(name = "nameParam") String name) {
return "Hello: " + name;
}
}
pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.training.rs</groupId>
<artifactId>jax_ws_wsgen_tool</artifactId>
<packaging>war</packaging>
<version>1.0</version>
<build>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>6.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>