Call WebService to view QQ number status

Source: Internet
Author: User
Tags wsdl

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.