WebService通过JDK生成客户端

1.运行cmd

2.输入

wsimport -keep http://127.0.0.1:8080/a/cxfservice/CxfForStudentService?wsdl -p com.test

3.生成客户端

在com.test文件夹下拷贝生成的客户端包到自己的项目中。就可以用Service了

如:调用例子

CxfForStudentService_Service cxfObject=new CxfForStudentService_Service() ;
            
        CxfForStudentService cxfForStudentService=CxfForStudentService.getCxfForStudentServicePort();
        cxfForStudentService.getStudent(1);

 

 

4.CXF CLIENT生成客户端

wsdl2java  -frontend jaxws21 -p creditcc.ws.rdm -d D:\cn\creditease\ws\model\callcenterws  -all http://127.0.01:8080/demo/cxfservice/cxfForDemoService?wsd

 

posted @ 2013-09-27 13:55  IT一族  阅读(172)  评论(0编辑  收藏  举报