通过PC Opera浏览器访问:
GET /wapuid/spi/service.do HTTP/1.1
user-agent:Opera/9.80 (Windows NT 5.1; U; zh-cn) Presto/2.6.30 Version/10.61
host:218.137.168.240:8080
accept:text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1
accept-language:zh-CN,zh;q=0.9,en;q=0.8
accept-charset:iso-8859-1, utf-8, utf-16, *;q=0.1
accept-encoding:deflate, gzip, x-gzip, identity, *;q=0
connection:Keep-Alive
手机CMWAP拨号访问(基于代理的应用模式):
清单1:
GET /wapuid/spi/service.do HTTP/1.1
host:218.137.168.240:8080
accept:*/*, text/x-vcard, text/x-vcalendar, image/gif, image/vnd.wap.wbmp
content-length:0
via:WTP/1.1 GDGZ-PB-GW011-WAP22 (Nokia WAP Gateway 4.1 CD1/ECD13_D/4.1.04) (说明经过了代理网关)
x-forwarded-for:10.249.142.203 (WAP网关地址)
x-up-calling-line-id:15659590673 (有可能是086打头)
x-source-id:SZHGGSN202BNk (核心网GGSN网元)
x-nokia-connection_mode:TCP
x-up-bearer-type:GPRS (无线网络类型)
x-nokia-gateway-id:NWG/4.1/Build4.1.04
connection:close
清单2:
GET /wapuid/spi/service.do HTTP/1.0
connection:Keep-Alive
host:218.137.168.240:8080
accept:application/vnd.wap.wmlc, application/vnd.wap.wmlscriptc, text/vnd.wap.wml, image/vnd.wap.wbmp, */*
accept-charset:utf-8, iso-8859-1
accept-language:en, zh-cn
x-online-host:218.137.168.240:8080
via:HTTP/1.1 GDSZ-PS-WAP11-GW029 (infoX-WISG, Huawei Technologies)
手机CMNET拨号访问:
清单1:
GET /wapuid/spi/service.do HTTP/1.1
host:218.137.168.240:8080
accept:*/*
user-agent:UNTRUSTED/1.0
x-online-host:218.137.168.240:8080
手机彩信拨号访问(基于代理的应用模式):
与CMWAP拨号的数据包格式相同
清单1:
GET /wapuid/spi/service.do HTTP/1.1
host:218.137.168.240:8080
accept:*/*
x-online-host:218.137.168.240:8080
cookie:jid=M5FmQZt1W5!1950346616;$path=/
x-forwarded-for:10.220.244.117
via:ZXWAP GateWay,ZTE Technologies
connection:close
应用1:
针对J2ME编程,不管用户是选择CMWAP拨号还是CMNET拨号,可以采用以下编程即可以访问
比如访问的URL为:url=http://218.137.168.240:8080/wapuid/spi/service.do
HttpConnection hc = (HttpConnection)Connector.open(url, Connector.READ, true);
hc.setRequestProperty("x-online-host","218.137.168.240");
如果是采用如下编程,即只能要求用户选择CMWAP拨号(假如WAP网关地址为10.0.0.172)
HttpConnection hc = (HttpConnection)Connector.open("http://10.0.0.172:8080/wapuid/spi/service.do", Connector.READ, true);
hc.setRequestProperty("x-online-host","218.137.168.240");
应用2:
服务器如何获取手机终端的APN类型:
可通过获取HTTP包头的"via"实体,如果该实体存在,即肯定是基于代理模式上网(如CMWAP拨号或彩信APN拨号)
如果服务器是白名单服务器,即不管是CMWAP拨号或彩信拨号均可以取到手机号
还有一种办法就是把移动的WAP网关IP都收集到,然后根据远程服务器的IP来判断。