加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

调用WebService查看QQ号码状态

发布时间:2020-12-16 23:14:32 所属栏目:安全 来源:网络整理
导读:1.1. ?webService服务接口 QQ在线状态 WEB 服务 Endpoint:http://webservice.webxml.com.cn/webservices/qqOnlineWebService.asmx? Disco:http://webservice.webxml.com.cn/webservices/qqOnlineWebService.asmx?disco? WSDL:http://webservice.webxml.com.c
1.1. ?webService服务接口 QQ在线状态 WEB 服务 Endpoint:http://webservice.webxml.com.cn/webservices/qqOnlineWebService.asmx? Disco:http://webservice.webxml.com.cn/webservices/qqOnlineWebService.asmx?disco? WSDL:http://webservice.webxml.com.cn/webservices/qqOnlineWebService.asmx?wsdl 通过输入QQ号码(String)检测QQ在线状态。 返回数据(String)Y = 在线;N = 离线;E = QQ号码错误...... 1.2. ?使用案例 1) ? ? ? ?新建一个java web项目,命名为qqws 2) ? ? ? ?在cmd命令行切换至一个空的目录,输入如下命令,下载webservice wsimport–keep http://webservice.webxml.com.cn/webservices/qqOnlineWebService.asmx?wsdl 会发现该目录下多了很多文件,将所有的文件复制到项目中 3) ? ? ? ?编写测试类Test.java package cn.com.webxml; ? public class Test { ? ? ? ? ? ?public static void main(String[] args) { ? ? ? ? ? ? ? ? ? ?QqOnlineWebServiceSoap ws = new QqOnlineWebService() ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?.getPort(QqOnlineWebServiceSoap.class); ? ? ? ? ? ? ? ? ? ?String qq = "1508787838"; ? ? ? ? ? ? ? ? ? ? ?String result = ws.qqCheckOnline(qq); ? ? ? ? ? ? ? ? ? ? ?System.out.println(result); ? ? ? ? ? ? ? ? ? ? ?// String,Y = 在线;N = 离线;E = QQ号码错误;A = 商业用户验证失败;V = 免费用户超过数量 ? ? ? ? ? ? ? ? ? ?if ("Y".equalsIgnoreCase(result)) { ? ? ? ? ? ? ? ? ? ? ? ? ? ? result = "在线"; ? ? ? ? ? ? ? ? ? ?} else if ("N".equalsIgnoreCase(result)) { ? ? ? ? ? ? ? ? ? ? ? ? ? ? result = "离线"; ? ? ? ? ? ? ? ? ? ?} else if ("E".equalsIgnoreCase(result)) { ? ? ? ? ? ? ? ? ? ? ? ? ? ? result = "QQ号码错误"; ? ? ? ? ? ? ? ? ? ?} else if ("A".equalsIgnoreCase(result)) { ? ? ? ? ? ? ? ? ? ? ? ? ? ? result = "商业用户验证失败"; ? ? ? ? ? ? ? ? ? ?} else if ("V".equalsIgnoreCase(result)) { ? ? ? ? ? ? ? ? ? ? ? ? ? ? result = "免费用户超过数量"; ? ? ? ? ? ? ? ? ? ?} ? ? ? ? ? ? ? ? ? ? ?System.out.println(result); ? ? ? ? ?} ? } ? 运行结果如下: Y

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读