用工具wsimport生成访问webservice的客户端代码
wsimport所在位置:
C:\Program Files\Java\jdk1.8.0\bin
wsimport -d D:/webservice -keep http://192.168.1.131:8080/BillingSystem/com.mobile263.billing.webservices.service.EsWebservice?wsdl
-keep:是否生成java源文件
-d:指定输出目录
-s:指定源代码输出目录
-p:以package的形式生成文件
-verbose:在控制台显示输出信息
调用代码:
public class TestClient { public static void main(String[] args) { EsWebserviceImplService service = new EsWebserviceImplService(); EsWebservice esWebservice = service.getEsWebserviceImplPort(); StringArray sa= esWebservice.querySJList("17091234567", 20140212151617l, 20140212151690l, "SJ"); System.out.println(sa.getItem()); } }
[{"areaCode":"010 ","roamType":"3 ","gloalRoamCost":"1234567890 ","upperFlow":123456789012345,"downFlow":123456789012345,"billingNumber":"17091234567 ","startTime":"20140212151621","imsi":"460014890228030 ","endTime":"20140212151622"}, {"areaCode":"010 ","roamType":"0 ","gloalRoamCost":"1234567890 ","upperFlow":123456789012345,"downFlow":123456789012345,"billingNumber":"17091234567 ","startTime":"20140212151617","imsi":"460014890228030 ","endTime":"20140212151618"}, {"areaCode":"010 ","roamType":"3 ","gloalRoamCost":"1234567890 ","upperFlow":123456789012345,"downFlow":123456789012345,"billingNumber":"17091234567 ","startTime":"20140212151619","imsi":"460014890228030 ","endTime":"20140212151620"}]