package com.service;
import javax.jws.WebService;
import javax.xml.ws.Endpoint;
@WebService
public class HelloService {
public String sayHello(String name){
return "Hello "+name;
}
/**
* @param args
*/
public static void main(String[] args) {
Endpoint.publish("http://10.19.10.147:1234/hello", new HelloService());
System.out.println("发布成功");
}
}
import javax.jws.WebService;
import javax.xml.ws.Endpoint;
@WebService
public class HelloService {
public String sayHello(String name){
return "Hello "+name;
}
/**
* @param args
*/
public static void main(String[] args) {
Endpoint.publish("http://10.19.10.147:1234/hello", new HelloService());
System.out.println("发布成功");
}
}
![](http://img.bbs.csdn.net/upload/201406/19/1403159849_352632.jpg)
![](http://img.bbs.csdn.net/upload/201406/19/1403159881_317938.jpg)