Use WebServices to call the weather mobile service online

Source: Internet
Author: User

Find http://www.webxml.com.cn/zh_cn/index.aspx, there are free to provide the cell phone attribution to the query and weather query WebServices services.

The corresponding client class is generated using the Wsimport-keep sei address. You can also save the WSDL document corresponding to the SEI address locally, and then use Wsimport to read the local WSDL document to generate the client class code.


Weather forecast:



Clienttest Code:

Package Com.wiseweb.weather_client_test;import Java.util.list;import Cn.com.webxml.arrayofstring;import Cn.com.webxml.weatherws;import Cn.com.webxml.weatherwssoap;public class Clienttest {public static void main (string[] args) {Weatherws Weatherws = new Weatherws (); Weatherwssoap Weatherwssoap = Weatherws.getweatherwssoap (); Arrayofstring weather = weatherwssoap.getweather ("Beijing", "" "); list<string> list = weather.getstring (); SYSTEM.OUT.PRINTLN (list);}}

Operation Result:

[Beijing, Beijing, 792, 2015/03/03 10:10:03, today's weather: Air temperature: 0 ℃; wind/Wind: North wind 4; Humidity: 11%, air quality: no; UV intensity: weak, sunglasses index: very necessary. Sun glasses with anti-dust features are recommended for daytime travel. Dressing index: cold. Recommended a thick down jacket and other winter clothing. Tourism index: more unfavorable. Strong winds may be detrimental to travel and need to bring windproof clothing. Movement Index: more unfavorable. The wind is very large, it is recommended that you do indoor sports. Car Wash Index: more unfavorable. The wind is bigger, the car will be covered with dust after washing. Makeup index: Moisturizing. Please choose moisturizing and moisturizing type cosmetics. Cold index: Very easy to send. Strong cooling, cold weather, strong wind. Air Pollution index: not currently. UV index: weak. The radiation is weak, rub spf12-15, pa+ skin care product. Comfort Index: less comfortable. Cooler day, strong wind, cold.  , March 3 Cloudy, -4℃/4℃, North wind 5-6 grade to 3-4, 1.gif, 1.gif, March 4 Sunny Turn cloudy, -5℃/5℃, no continuous wind breeze, 0.gif, 1.gif, March 5 Sunny Turn Cloudy, -3℃/8℃, no continuous wind breeze, 0.gif, 1.gif, March 6 Cloudy, -1℃/9℃, no continuous wind breeze, 1.gif, 1.gif, March 7 Cloudy to clear, 0 ℃/9 ℃, no continuous wind breeze, 1.gif, 0.gif]



mobile phone Attribution to query:



Phonetest:

Package Com.wiseweb.phone_client_test;import Cn.com.webxml.mobilecodews;import Cn.com.webxml.MobileCodeWSSoap; public class Phonetest {public static void main (string[] args) {mobilecodews mobilecodews = new Mobilecodews (); Mobilecodewssoap Mobilecodewssoap = Mobilecodews.getmobilecodewssoap (); String result = Mobilecodewssoap.getmobilecodeinfo ("18513429793", ""); SYSTEM.OUT.PRINTLN (Result + "* *");}}

Operation Result:
18513429793: Beijing BEIJING China Unicom GSM Card * *


Use WebServices to call the weather mobile service online

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.