package com.rg2.webservice.impl; import javax.xml.ws.Endpoint; import com.rg2.webservice.HelloWorld; public class Server { public static void main(String[] args) { System.out.println("web service start"); HelloWorld implementor = new HelloWorldImpl(); String address = "http://localhost/helloWorld"; Endpoint.publish(address, implementor);//jdk实现暴露webservice接口 System.out.println("web service started"); } }
package com.rg2.webservice.impl; import javax.jws.WebService; import com.rg2.webservice.HelloWorld; @WebService public class HelloWorldImpl implements HelloWorld { @Override public String say(String str) { return "hello"+str; } }
package com.rg2.webservice; import javax.jws.WebService; @WebService public interface HelloWorld { public String say(String str); }
暂时未解