Processing of the China Mobile charges page in the j2_mm-net Program

Source: Internet
Author: User

Since China Mobile launched the Internet tariff page reminder, many of the problems caused by the failure to connect to the server in the connection to the j2's network. That is to say, after the network is enabled in the agent program of the agent in the agent program, in some regions, the mobile gateway will cut down our request and return a notification page for the fee, in this way, our server will not receive our request, resulting in an error in program connection failure.

Therefore, when processing network connections, we need to add processing for the mobile charges page. We can check the returned response header after sending network requests, if we detect that the returned Content-Type is text/vnd. WAP. WML, We can discard this response and initiate a new request to solve the tariff page problem, or we can extract the request address in the tariff page and send a request again.

The Code is as follows:

Httpconn = (httpconnection) connector. Open (URL, permissions, true );

String S = httpconn. getheaderfield ("Content-Type ");

If (S. Equals ("text/vnd. WAP. WML ")){

// Initiate a new request
Httpconn = (httpconnection) connector. Open (URL, permissions, true );
}

If the type to be returned by the program is the WAP page, we can perform keyword parsing on the content of the WAP page to determine whether the page is returned by the server or the pay-as-you-go reminder page is sent by mobile.

 

From: http://www.j2medev.com/bbs/dispbbs.asp? Boardid = 54 & id = 30599

 

 

Qingkai IT Training Base-Seo in Qingdao Development Zone

 

 

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.