一些webservice接口及应用
发布时间:2020-12-17 00:41:06 所属栏目:安全 来源:网络整理
导读:快递查询接口?http://webservice.36wu.com/ExpressService.asmx ip查询接口?http://webservice.36wu.com/ipService.asmx 天气预报接口?http://webservice.36wu.com/weatherService.asmx 身份证查询接口?http://webservice.36wu.com/IdCardService.asmx 手机
快递查询接口?http://webservice.36wu.com/ExpressService.asmx
ip查询接口?http://webservice.36wu.com/ipService.asmx 天气预报接口?http://webservice.36wu.com/weatherService.asmx 身份证查询接口?http://webservice.36wu.com/IdCardService.asmx 手机归属地接口?http://webservice.36wu.com/MobilePhoneService.asmx 翻译接口?http://webservice.36wu.com/TranslationService.asmx 火车时刻接口:http://webservice.36wu.com/TrainService.asmx 股票查询接口:http://webservice.36wu.com/StockService.asmx? 邮编接口:http://webservice.36wu.com/ZipcodeService.asmx 二维码Web服务? http://webservice.36wu.com/DimensionalCodeService.asmx 公交查询Web服务? http://webservice.36wu.com/mapService.asmx? ISBN查询Web服务 http://webservice.36wu.com/ISBNService.asmx ICP备案查询Web服务 ?http://webservice.36wu.com/ICPServic.asmx import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; import java.net.URL; import java.net.URLConnection; //获取本机外网ip public class getIP { public static String getMyIp() { String ipAddress= null; try { URL url = new URL( "http://webservice.36wu.com/ipService.asmx/getMyIP"); URLConnection conn = url.openConnection(); conn .setRequestProperty( "User-Agent","Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.15) Gecko/20110303 Firefox/3.6.15"); conn.setRequestProperty("Content-Type","text/html"); conn .setRequestProperty("Accept","text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"); InputStream is = conn.getInputStream(); BufferedReader br = new BufferedReader(new InputStreamReader(is,"utf-8")); String line = null; while ((line = br.readLine()) != null) { // System.out.println(line); if(line.contains("string")) { int beginIndex = line.indexOf("<string>")+8; int lastIndex = line.lastIndexOf("<"); ipAddress = line.substring(beginIndex,lastIndex); //System.out.println(ip); break; } } } catch (Exception e) { } return ipAddress; } public static void main(String args[]) { System.out.println(getMyIp()); } } (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |