1. 程式人生 > >webService —— soap

webService —— soap

webmethod oca div obj brush mes running method say

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;
	}
}

webService —— soap