ÊÖ»úÕ¾
ÍøÍ¨·ÖÕ¾
µçÐÅÖ÷Õ¾
ÃÜ¡¡Âë:
Óû§Ãû£º
µ±Ç°Î»Öà : Ö÷Ò³>ÍøÂç±à³Ì>Asp.Net±à³Ì>Áбí

ÔÚASP.NET AtlasÖе÷ÓÃWeb Service¡ª´´½¨Mashupµ÷ÓÃÔ¶¶ËWeb Service£¨Yahoo!ÌìÆøÊµÀý£

À´Ô´£º»¥ÁªÍø ×÷Õߣºwest263.com ʱ¼ä£º2008-02-22
Î÷²¿ÊýÂë-È«¹úÐéÄâÖ÷»ú10Ç¿£¡40ÓàÏîÐéÄâÖ÷»ú¹ÜÀí¹¦ÄÜ,È«¹úÁìÏÈ!Ë«Ïß¶àÏßÐéÄâÖ÷»úÄϱ±·ÃÎʳ©Í¨ÎÞ×è!Ãâ·ÑÔùËÍÆóÒµÓʾÖ,.CNÓòÃû,×ÔÖú½¨Õ¾480ÔªÆð,Ãâ·ÑÊÔÓÃ7Ìì,ÂúÒâÔÙ¸¶¿î! P4Ö÷»ú×âÓÃ799Ôª/ÔÂ.Ô¸¶Ãâѹ½ð!

×÷ÕߣºDflying Chen £¨http://dflying.cnblogs.com/£©
ÔÚǰһƪÎÄÕ£¨ÔÚASP.NET AtlasÖе÷ÓÃWeb Service¡ª¡ª´´½¨Mashupµ÷ÓÃÔ¶¶ËWeb Service£¨»ù´¡ÖªÊ¶ÒÔ¼°¼òµ¥Ê¾Àý£©£©ÖУ¬ÎÒ½éÉÜÁËһЩAtlasÖжÔÔ¶³ÌWeb Service½øÐÐMashupµÄ»ù´¡ÖªÊ¶£¬²¢¸ø³öÁËÒ»¸ö×î»ù´¡µÄûÓÐË¿ºÁÓô¦Àý×Ó¡£½ñÌìÔٻص½Õâ¸ö»°ÌâÉÏ£¬ÎÒ½«¸ø³öÒ»¸ö¸ü¸´ÔÓµãµÄ£¬µ«ÓÐһЩÓô¦µÄÀý×Ó¡ª¡ªYahoo! Weather¡£

·Ï»°µ½´ËΪֹ£¬ÈÃÎÒÃÇÏÈÊìϤһÏÂYahoo! Weather·þÎñ£ºYahoo!ÔÚÆäÍøÕ¾ÉÏÌṩÁËÌìÆøÔ¤±¨·þÎñ£¨http://weather.yahoo.com/£©£¬²¢ÇÒËüÒ²ÌṩÁËWeb ServiceµÄ½Ó¿Ú£¨http://developer.yahoo.com/weather/£©
´ÓÉÏÃæÁ½¸öÍøÒ³ÉÏÃæ£¬ÎÒÃÇ¿ÉÒÔÖªµÀYahoo!ÌṩµÄÌìÆøServiceµÄURLΪhttp://xml.weather.yahoo.com/forecastrss£¬¸Ã·þÎñ»¹ÓÐÁ½¸ö²ÎÊý£º

p£ºÒª²éѯÌìÆøµÄµØµã´úÂ루¿ÉÒÔÔÚhttp://weather.yahoo.com/²éѯµ½²»Í¬µØ·½µÄÕâ¸ö´úÂ룩¡£
u£º·µ»Ø½á¹ûÖÐζȵĵ¥Î»£¬f´ú±í»ªÊ϶ȣ¬c´ú±íÉãÊ϶ȡ£
¿´À´Õâ¸öYahoo! Weather·þÎñ»¹Í¦¼òµ¥µÄ£¬ÈÃÎÒÃDzâÊÔϺò»ºÃÓá£Ïȵ½http://weather.yahoo.com/²é³öÀ´ÉϺ£µÄµØµã´úÂëΪCHXX0116¡£È»ºóÔÚä¯ÀÀÆ÷ÖÐÊäÈëhttp://xml.weather.yahoo.com/forecastrss?p=CHXX0116&u=c£¬àÅ£¬·µ»ØÁËÈçϵÄÒ»¶Î²»ÊǺܸ´ÔÓµÄXML£º

Yahoo Weather Service XML Result
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<rss version="2.0" xmlns:yweather="http://xml.weather.yahoo.com/ns/rss/1.0" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#">
<channel>
<title>Yahoo! Weather - Shanghai, CH</title>
<link>http://us.rd.yahoo.com/dailynews/rss/weather/Shanghai__CH/*http://xml.weather.yahoo.com/forecast/CHXX0116_c.html</link>
<description>Yahoo! Weather for Shanghai, CH</description>
<language>en-us</language>
<lastBuildDate>Thu, 25 May 2006 11:00 am CST</lastBuildDate>
<ttl>60</ttl>
<yweather:location city="Shanghai" region="" country="CH" />
<yweather:units temperature="C" distance="km" pressure="mb" speed="kph" />
<yweather:wind chill="21" direction="260" speed="14" />
<yweather:atmosphere humidity="78" visibility="299" pressure="0" rising="0" />
<yweather:astronomy sunrise="4:52 am" sunset="6:50 pm" />
<image>
<title>Yahoo! Weather</title>
<width>142</width>
<height>18</height>
<link>http://weather.yahoo.com/</link>
<url>http://us.i1.yimg.com/us.yimg.com/i/us/nws/th/main_142b.gif</url>
</image>
<item>
<title>Conditions for Shanghai, CH at 11:00 am CST</title>
<geo:lat>31.17</geo:lat>
<geo:long>121.43</geo:long>
<link>http://us.rd.yahoo.com/dailynews/rss/weather/Shanghai__CH/*http://xml.weather.yahoo.com/forecast/CHXX0116_c.html</link>
<pubDate>Thu, 25 May 2006 11:00 am CST</pubDate>
<yweather:condition text="Fog" code="20" temp="21" date="Thu, 25 May 2006 11:00 am CST" />
<description>
<![CDATA[
<img src="/info/upimg/allimg/080224/1954440.gif" /><br />
<b>Current Conditions:</b><br />
Fog, 21 C<BR /><BR />
<b>Forecast:</b><BR />
Thu - Scattered Thunderstorms. High: 25 Low: 20<br />
Fri - AM Showers. High: 26 Low: 18<br />
<br />
<a href="Full'>http://us.rd.yahoo.com/dailynews/rss/weather/Shanghai__CH/*http://xml.weather.yahoo.com/forecast/CHXX0116_c.html">Full Forecast at Yahoo! Weather</a><BR/>
(provided by The Weather Channel)<br/>
]]>
</description>
<yweather:forecast day="Thu" date="25 May 2006" low="20" high="25" text="Scattered Thunderstorms" code="38" />
<yweather:forecast day="Fri" date="26 May 2006" low="18" high="26" text="AM Showers" code="39" />
<guid isPermaLink="false">CHXX0116_2006_05_25_11_0_CST</guid>
</item>
</channel>
</rss>
<!-- p1.weather.scd.yahoo.com uncompressed/chunked Thu May 25 20:49:07 PDT 2006 -->

ÎÒÃÇ¿ÉÒÔ¿´µ½£¬ËüÌṩµÄÐÅÏ¢·Ç³£È«Ã棨Á¬ÈÕ³öÈÕÂäʱ¼ä¶¼ÓС­¡­£©£¬ÏÂÃæÈÃÎÒÃÇÊéдasbx BridgeÒ³ÃæÀ´¶ÔÕâ¸öService½øÐÐMashup¡£

Ê×ÏÈ£¬²Î¿¼ÔÚASP.NET AtlasÖе÷ÓÃWeb Service¡ª¡ª´´½¨Mashupµ÷ÓÃÔ¶¶ËWeb Service£¨»ù´¡ÖªÊ¶ÒÔ¼°¼òµ¥Ê¾Àý£©ÕâÆªÎÄÕÂÖеÄÄǸöasbxµÄÉùÃ÷£¬ÎÒÃÇ¿ÉÒÔд³öÈçÏÂÒ»¶Î£º

<?xml version="1.0" encoding="utf-8" ?>
<bridge namespace="Dflying" className="YahooWeatherService">

<proxy type="Microsoft.Web.Services.BridgeRestProxy"
serviceUrl="http://xml.weather.yahoo.com/forecastrss" />

<method name="GetWeather">
<input>
<parameter name="p" />
<parameter name="u" value="c" />
</input>
</method>
</bridge>

ÆäÖУº
<bridge>µÄnamespaceºÍclassNameÊôÐÔÒÔ¼°<method>µÄnameÊôÐÔÈÃÎÒÃÇÔÚ¿Í»§¶ËJavaScriptÖпÉÒÔͨ¹ýDflying.YahooWeatherService.GetWeather()ÕâÑùµÄ·½·¨Ç©ÃûÀ´·ÃÎÊÕâ¸öMashup¡£

ÎÄÕÂÕûÀí£ºÎ÷²¿ÊýÂë--רҵÌṩÓòÃû×¢²á¡¢ÐéÄâÖ÷»ú·þÎñ
http://www.west263.com
ÒÔÉÏÐÅÏ¢ÓëÎÄÕÂÕýÎÄÊDz»¿É·Ö¸îµÄÒ»²¿·Ö,Èç¹ûÄúÒª×ªÔØ±¾ÎÄÕÂ,Çë±£ÁôÒÔÉÏÐÅÏ¢£¬Ð»Ð»!