package soupTest;import javax.jws.WebMethod;import javax.jws.WebService;import javax.xml.ws.Endpoint;@WebServicepublic class Main {public static void main(String[] args) {System.out.println("server is running");String address = "http://localhost:9000/Main";Object implementor = new Main();Endpoint.publish(address, implementor);}@WebMethodpublic String sayHello(String str) {System.out.println("get message...");String result = "hello" + str;return result;}}
webService —— soap
原文地址:http://www.cnblogs.com/Mr24/p/8048650.html