Java???webservice???
???????????? ???????[ 2014/2/11 9:41:10 ] ????????Java webservice tomcat
??????? WEB-INF ???? ??web.xml??????У?WEB.XML???????????????axis???????????????????????????????
<servlet>
<servlet-name>AxisServlet</servlet-name>
<servlet-class>org.apache.axis.transport.http.AxisServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>AxisServlet</servlet-name>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>
?????????????????????
package server;
public class SayHello {
public String getName(String name) {
return "hello====>" + name;
}
}
?????壺??????????????????????????
package client;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
public class TestClient {
public static void main(String[] args) throws Exception {
// ???service????URL
String endpoint = "http://127.0.0.1:8082/webservice/services/Login.jws";
// ???????????(service)????(call)
Service service = new Service();
Call call = (Call) service.createCall();// ???service????call????
// ????service????URL
call.setTargetEndpointAddress(new java.net.URL(endpoint));
// ??????(processService)??MyService.java?????????????
call.setOperationName("getName");
// Object ??????????????????"This is Test!"??????processService(String arg)
String ret = (String) call.invoke(new Object[] { "????" });
System.out.println(ret);
}
}
???????????tomcat???????http://127.0.0.1:8082/webservice/services????????з??????????????????????????????????????????
???????Ч??????????
And now... Some Services
Login.jws (wsdl)
getName
?????????????????????TestClient??????н?????????????ɡ?
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11