WebService getting weather information

Source: Internet
Author: User

 Call the free web service to get weather forecast information first find the weather forecast provides WebService network address: WSDL file description http://webservice.webxml.com.cn/WebServices/ Weatherws.asmx wsdl file http://webservice.webxml.com.cn/WebServices/WeatherWS.asmx?wsdl then save as webservice.wsdl modify file <s:element ref= "S:schema"/></any> for <s:any minoccurs= "2" maxoccurs= "2"/> Then build javaproject<p> in MyEclipse create WebClient client </p><p> then call 4 import java.util.List; 5 Import cn.com.webxml.ArrayOfString; 6 Import Cn.com.webxml.WeatherWS; 7 Import Cn.com.webxml.WeatherWSSoap;         8 9 public class Weatherwsclient {Ten public static void Main (string[] args) {12//Create a WEATHERWS factory 13 WEATHERWS factory = new Weatherws (); 14//Create a Weatherwssoap object according to the factory weatherwssoap Weatherwssoap = Factory . Getweatherwssoap (); 16//Call the GetWeather method provided by WebService to get the weather forecast for Zhengzhou. arrayofstring Weatherinfo = Weatherwsso       Ap.getweather ("Zhengzhou", null); List<string> lstweatherinfo = weatherinfo.getstring (); 19//Traverse weather forecast Information 20  for (string string:lstweatherinfo) {System.out.println (string); System.out.println ("----- -------------------");}24}25}</p>


</pre><br/><br/>


WebService getting weather information

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.