1.选中要调用的服务单击”服务说明”

So easy Webservice 4.Java方式访问WebService(使用jdk1.6以上 wsimport命令)

2.获取wsdl文件.使用JDK1.6以上的版本的wsimport命令

a) 例如选中:http://webservice.webxml.com.cn/WebServices/MobileCodeWS.asmx?WSDL

b) 获取wsdl文件.使用JDK1.6以上的版本的wsimport命令:cmd中使用wsimport命令:

C:\ws>wsimport -s(-c) . -p com.mlxs.ws.mobilecode http://webservice.webxml.com.cn/WebServices/MobileCodeWS.asmx?WSDL

 So easy Webservice 4.Java方式访问WebService(使用jdk1.6以上 wsimport命令)

 

生成文件:

So easy Webservice 4.Java方式访问WebService(使用jdk1.6以上 wsimport命令)

c) 可以把class文件打成jar包 jar cvf  test.jar 打包目录

3.拷贝的项目中调参考WSDL用即可调用源码如下:

public static void main(String[] args) {
        MobileCodeWS mobileCodeWs=new MobileCodeWS();
        MobileCodeWSSoap mobileCodeWSSoap=mobileCodeWs.getMobileCodeWSSoap();
        String tel=mobileCodeWSSoap.getMobileCodeInfo("18373551982",null);
        System.out.println(tel);
    }

 

 

相关文章:

  • 2021-06-14
  • 2022-12-23
  • 2021-11-20
  • 2021-06-29
  • 2021-05-16
  • 2021-04-04
  • 2021-12-18
猜你喜欢
  • 2022-03-04
  • 2021-07-12
  • 2022-01-16
  • 2022-02-26
  • 2021-06-21
  • 2021-11-27
  • 2021-11-28
相关资源
相似解决方案