Call WebService to view QQ number status
1.1. WebService Service Interface
QQ Online Status WEB service
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 Online status is detected by entering QQ number (String).
Return data (String) Y = online; N = offline; E = QQ number error ...
1.2. Use Cases
1) Create a new Java Web project named Qqws
2) on the cmd command line switch to an empty directory, enter the following command, download WebService
Wsimport–keep http://webservice.webxml.com.cn/webservices/qqOnlineWebService.asmx?wsdl
Will find a lot more files in this directory, copy all the files to the project
3) Write test class 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 = online; N = offline; E = QQ number error; A = Commercial user authentication failed; V = number of free users exceeded if ("Y". Equalsignorecase (Result)) { result = "Online"; } else if ("N". Equalsignorecase (Result)) { result = "Offline"; } else if ("E". Equalsignorecase (Result)) { result = "QQ number error"; } else if ("A". Equalsignorecase (Result)) { result = "Commercial user authentication failed"; } else if ("V". Equalsignorecase (Result)) { result = "Free user exceeds quantity"; } SYSTEM.OUT.PRINTLN (result); } } |
The results of the operation are as follows:
Y
Online
Call WebService to view QQ number status