调用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
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- 除了scalate之外还有Scala模板引擎吗?
- Bash脚本 – 读取二进制文件
- angularjs 八
- angular – 如何捕获* ngIf中的路线
- angularjs – 表情符号支持textarea或contenteditable div
- PXE远程安装系统的部署——(单台系统可给多台裸机远程安装
- sbt – 如何在Play 2.2.x的dist任务中禁用ScalaDoc生成(使用
- 自定义工具MSDiscoCodeGenerator失败,对象"Settings&#
- angularjs – Angular $routeProvider和Controller As Synt
- 单元测试 – 使用Jasmine测试AngularJS工厂功能