webService —— soap

package soupTest;

import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.xml.ws.Endpoint;

@WebService
public 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);
		
	}
	@WebMethod
	public String sayHello(String str) {
		
		System.out.println("get message...");
		String result = "hello" + str;
		return result;
	}
}

 

posted @ 2017-12-17 01:02  motivated_Dou  阅读(168)  评论(0编辑  收藏  举报