<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>nightdrops.com &#187; webservices</title>
	<atom:link href="http://www.nightdrops.com/tag/webservices/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nightdrops.com</link>
	<description>like the color blue</description>
	<lastBuildDate>Thu, 01 Jul 2010 13:19:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Requesting Webservices in Flex 3</title>
		<link>http://www.nightdrops.com/2009/requesting-webservices-in-flex-3/</link>
		<comments>http://www.nightdrops.com/2009/requesting-webservices-in-flex-3/#comments</comments>
		<pubDate>Tue, 13 Jan 2009 15:25:25 +0000</pubDate>
		<dc:creator>kajyr</dc:creator>
				<category><![CDATA[Blog posts]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[last.fm]]></category>
		<category><![CDATA[mxml]]></category>
		<category><![CDATA[webservices]]></category>

		<guid isPermaLink="false">http://www.nightdrops.com/?p=77</guid>
		<description><![CDATA[Follows Webservices, simple introduction. In Flex 3 requesting data is really simple, since you really have to load a well know url which prints out XML (or JSON or whatever). I assume you have read the introduction, here we are with a url that prints out informations about Cher&#8217;s top fans: http://ws.audioscrobbler.com/2.0/?method=artist.gettopfans&#38;artist=cher&#38;api_key=xxxxxxxxxxxx What we have to [...]]]></description>
			<content:encoded><![CDATA[<p>Follows <a href="http://www.nightdrops.com/2009/01/webservices-simple-introduction/" target="_self">Webservices, simple introduction.</a></p>
<p>In Flex 3 requesting data is really simple, since you really have to load a well know url which prints out XML (or JSON or whatever).</p>
<p>I assume you have read the introduction, here we are with a url that prints out informations about Cher&#8217;s top fans:</p>
<pre>http://ws.audioscrobbler.com/2.0/?method=artist.gettopfans&amp;artist=cher&amp;api_key=xxxxxxxxxxxx</pre>
<p>What we have to do is load that url with a mx:HTTPService Object and parse the result as XML. Simple, it isn&#8217;t?</p>
<p>First: create the HTTPService object:</p>
<div class="codecolorer-container mxml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><br /><strong>GeSHi Error:</strong> GeSHi could not find the language mxml (using path /nfs/c03/h01/mnt/85630/domains/nightdrops.com/html/wp-content/plugins/snipplr/geshi/geshi/) (code 2)<br /></div>
<p>and the handlers</p>
<div class="codecolorer-container actionscript3 default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><br /><strong>GeSHi Error:</strong> GeSHi could not find the language actionscript3 (using path /nfs/c03/h01/mnt/85630/domains/nightdrops.com/html/wp-content/plugins/snipplr/geshi/geshi/) (code 2)<br /></div>
<div class="codecolorer-container actionscript3 default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><br /><strong>GeSHi Error:</strong> GeSHi could not find the language actionscript3 (using path /nfs/c03/h01/mnt/85630/domains/nightdrops.com/html/wp-content/plugins/snipplr/geshi/geshi/) (code 2)<br /></div>
<p>And oplà, in the data field you will have the returned xml, ready to be shown in your preferred component!</p>
<p><a href="http://www.nightdrops.com/wp-content/uploads/2009/01/requesting-webservices-in-flex-3.zip" onClick="javascript: pageTracker._trackPageview('/downloads/requesting-webservices-in-flex-3.zip>You can download the code</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nightdrops.com/2009/requesting-webservices-in-flex-3/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Webservices, simple introduction.</title>
		<link>http://www.nightdrops.com/2009/webservices-simple-introduction/</link>
		<comments>http://www.nightdrops.com/2009/webservices-simple-introduction/#comments</comments>
		<pubDate>Tue, 13 Jan 2009 15:08:44 +0000</pubDate>
		<dc:creator>kajyr</dc:creator>
				<category><![CDATA[Blog posts]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[last.fm]]></category>
		<category><![CDATA[webservices]]></category>

		<guid isPermaLink="false">http://www.nightdrops.com/?p=72</guid>
		<description><![CDATA[Website exposes their data to 3rd part application trought webservices and xml. It&#8217;s pretty simple: the user calls a url which has some parameters that contains the request, the webserver handles the request, queries the database and prints out the resulting data in XML (or JSON, or other) format. This permits to limit user access [...]]]></description>
			<content:encoded><![CDATA[<p>Website exposes their data to 3rd part application trought webservices and xml. It&#8217;s pretty simple: the user calls a url which has some parameters that contains the request, the webserver handles the request, queries the database and prints out the resulting data in XML (or JSON, or other) format. This permits to limit user access to the complete data, exposing only a part of them.</p>
<p>This is the underlying technology that empowers all kinds of mashup: you request data from some sources, combine it and show them up in your application. I want to share some examples of building an app that works with data loaded from external webservices; I&#8217;m not gonna show you another flickr example, there are too many out there, so I&#8217;d prefer doing something using <a href="http://www.lastfm.it/api/intro">Last.fm APIs</a>.</p>
<p>First thing is, you have to <a href="http://www.lastfm.it/api/account">apply for an API KEY</a>. What does this means? Api calls somethines aren&#8217;t free, other times the provider wants to keep track of who calls which api, or keep statistics; So you have register a unique id that will sign all your calls. Usually you pass this key as a parameter of the function.</p>
<p>So to start, let&#8217;s choose a simple function to call, <a href="http://www.lastfm.it/api/show?service=310">artist.getTopFans</a> sounds good and doesn&#8217;t require authentication. It prints out informations about the top fans of a given artist. The documentation page tells that it requires 2 parameters: the artist name, and the api key, they explains themselves.</p>
<p>So now we know that we want to know who are the top fans of.. let&#8217;s say, Cher. We have to take the root url of the APIs, which is</p>
<p> </p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">http://ws.audioscrobbler.com/2.0/</div></div>
<p> </p>
<p>enqueued by the parameters written as<em> &amp;key=value</em> pairs (It&#8217;s a simple HTTP GET request, other services will require HTTP POST requests, but, later).<br />
We now have the url of the call, which should be similar to:</p>
<p> </p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">http://ws.audioscrobbler.com/2.0/?method=artist.gettopfans&amp;amp;artist=cher&amp;amp;api_key=xxxxxxxxxxxx</div></div>
<p>You can try substituting your api key and open that url in a web browser.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nightdrops.com/2009/webservices-simple-introduction/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
