Https://www.cnblogs.com/AlanLee/archive/2017/06/02/6933073.html
1, ordinary Java Pro NEW:
Package com.busy.webservice;
Import Javax.jws.WebService;
Import Javax.xml.ws.Endpoint;
@WebService public
class WebServiceTest {public
string transwords (string words) {
string res = ' ";
for (char Ch:words.toCharArray ()) {
res = + ch + ",";
}
return res;
}
public static void Main (string[] args) {
//Use Endpoint (Terminal) class to publish WebService
Endpoint.publish ("http://localhost : 8089/service/webservice ", New WebServiceTest ());
System.out.println ("Publish Success");
}
2, can use Test tool test: Storm_r1.1-adarna
3, Java WebService Client, first with the JDK with the Wsimport generated code
Wsimport-s. http://localhost:8089/service/webservice?wsdl
4, new Common Java Pro, the introduction of generated Java files
5, Direct call:
Package com.busy.webservice;
public class Maintest {public
static void Main (string[] args) {
webservicetestservice test = new Webservicetestse Rvice ();
WebServiceTest tes = Test.getport (webservicetest.class);
String self = tes.transwords ("Wahaha");
System.out.println (self);
}