RT
------解决方案--------------------
www.webxml.com.cn提供的有天气预报的webservice
------解决方案--------------------
- Java code
private static final String NAMESPACE = "http://WebXml.com.cn/"; private static String URL = "http://www.webxml.com.cn/webservices/weatherwebservice.asmx"; private static final String METHOD_NAME = "getWeatherbyCityName"; private static String SOAP_ACTION = "http://WebXml.com.cn/getWeatherbyCityName"; private SoapObject detail; public void getWeather(final String cityName) { try { SoapObject rpc = new SoapObject(NAMESPACE, METHOD_NAME); rpc.addProperty("theCityName", cityName); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); envelope.bodyOut = rpc; envelope.dotNet = true; envelope.setOutputSoapObject(rpc); HttpTransportSE ht = new HttpTransportSE(URL); ht.debug = true; ht.call(SOAP_ACTION, envelope); detail =(SoapObject) envelope.getResponse(); Log.i("TAG","getWeather "); GetData(detail,cityName); return; } catch (Exception e) { e.printStackTrace(); } }
------解决方案--------------------
www.webxml.com.cn提供的天气预报webservice地址:
http://www.webxml.com.cn/webservices/weatherwebservice.asmx
这个地址可以直接调用了。