import org.apache.axis.client.Call; import org.apache.axis.client.Service; public class ClientAxis { public static void main(String[] args) { try { // 指出service所在URL String endpoint = "http://192.168.2.108:8090/airforce/services/CarRecordWebService?wsdl"; // 创建一个服务(service)调用(call) Service service = new Service(); //Call call = (Call) service.createCall();// 通过service创建call对象 Call call =(Call)service.createCall(); // 设置service所在URL call.setTargetEndpointAddress(new java.net.URL(endpoint)); // 方法名(processService)与WebService中方法名保持一致 call.setOperationName("setShowMsg"); // Object 数组封装了参数,参数为"This is Test!",调用processService(String arg) // String rMsg = (String) call.invoke(new Object[] { // "devId-0001","cardId-70125","carNo-NY09007" }); String rMsg = (String) call.invoke(new Object[] { "00000379","2015-12-08 12:15:19", "0512440120001", "60000", "1", "0" }); System.out.println(rMsg); } catch (Exception e) { e.printStackTrace(); } } }
webservice调用是发布----axis
猜你喜欢
转载自zyengogo.iteye.com/blog/2273339
今日推荐
周排行