PageRenderTime 10ms CodeModel.GetById 1ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/test-ws/src/main/java/com/googlecode/wstester/test/service/TestService.java

http://ws-tester.googlecode.com/
Java | 40 lines | 29 code | 5 blank | 6 comment | 0 complexity | 4b341001e2e7df66c34b22832cf6feb0 MD5 | raw file
 1package com.googlecode.wstester.test.service;
 2
 3import org.apache.commons.lang.StringUtils;
 4
 5import javax.jws.WebMethod;
 6import javax.jws.WebParam;
 7import javax.jws.WebResult;
 8import javax.jws.WebService;
 9import javax.xml.ws.Endpoint;
10
11/**
12 * Created by IntelliJ IDEA.
13 * User: pablo
14 * Date: 2010-07-01
15 * Time: 08:04:39
16 */
17@WebService(targetNamespace = "http://test")
18public class TestService {
19  @WebMethod
20  public @WebResult(name = "helloMessage") String sayHelloWorldFrom(@WebParam(name = "name") String from) {
21    String result = "Hello, world, from " + from;
22    System.out.println(result);
23    return result;
24  }
25    @WebMethod
26    public @WebResult(name = "echo") String echo(@WebParam(name = "message") String message) {
27        return message;
28    }
29
30    @WebMethod
31    public @WebResult(name = "reversed") String reverse(@WebParam(name = "message") String message) {
32        return StringUtils.reverse(message);
33    }
34
35  public static void main(String[] argv) {
36    Object implementor = new TestService ();
37    String address = "http://localhost:9000/com.googlecode.wstester.test.service.TestService";
38    Endpoint.publish(address, implementor);
39  }
40}