文件名称:java实现WebService显示天气预报
文件大小:264KB
文件格式:RAR
更新时间:2013-02-15 17:19:06
java webservice 天气预报
本资源引用于http://download.csdn.net/source/1156344 我做了下改动,大家分享一下。 webService服务地址: http://www.webxml.com.cn/WebServices/WeatherWebService.asmx private static String getSoapRequest1(String city) { try { InputStreamReader isr = new InputStreamReader(new FileInputStream( "WebRoot/weather.xml")); BufferedReader reader = new BufferedReader(isr); StringBuffer soap = new StringBuffer(""); String tmp; while ((tmp = reader.readLine()) != null) { soap =soap.append(tmp); } reader.close(); isr.close(); return soap.toString().replace("${city}$", city); } catch (Exception ex) { ex.printStackTrace(); return null; } }