Java apache-cxf 客户端调用
apache-cxf的下载地址
http://cxf.apache.org/download.html
新建Java工程 WebServicesInvoke
在cxf Bin 下面执行 wsdl2java.bat http://localhost:8080/AjiaHEDU/ws/consultService?wsdl
public static void main(String[] args) { IConsultService service = new ConsultServiceImplService().getConsultServiceImplPort(); ConsultQueryParameter param = new ConsultQueryParameter(); param.setPageSize(20); param.setPageNumber(1); ConsultTo consult = new ConsultTo(); param.setConsult(consult); QueryResultBase result = service.searchConsultList(param); //存放返回的结果 result.getPageData(); //共有多少条数据 result.getTotal(); System.out.println(result.getTotal()); System.out.println(result.getPageData().size()); }
这样跟.net下是一样的,也比较简单