Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
11732 lines (10201 sloc) 904 KB
<?xml version="1.0" encoding="UTF-8"?>
<!-- This is a WordPress eXtended RSS file generated by WordPress as an export of your blog. -->
<!-- It contains information about your blog's posts, comments, and categories. -->
<!-- You may use this file to transfer that content from one site to another. -->
<!-- This file is not intended to serve as a complete backup of your blog. -->
<!-- To import this information into a WordPress blog follow these steps. -->
<!-- 1. Log in to that blog as an administrator. -->
<!-- 2. Go to Tools: Import in the blog's admin panels (or Manage: Import in older versions of WordPress). -->
<!-- 3. Choose "WordPress" from the list. -->
<!-- 4. Upload this file using the form provided on that page. -->
<!-- 5. You will first be asked to map the authors in this export file to users -->
<!-- on the blog. For each author, you may choose to map to an -->
<!-- existing user on the blog or to create a new user -->
<!-- 6. WordPress will then import each of the posts, comments, and categories -->
<!-- contained in this file into your blog -->
<!-- generator="WordPress.com" created="2011-09-13 15:07"-->
<rss version="2.0"
xmlns:excerpt="http://wordpress.org/export/1.0/excerpt/"
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:wp="http://wordpress.org/export/1.0/"
>
<channel>
<title>Fumbling Towards Geekstacy</title>
<link>http://ruprict.net</link>
<description>Ugh, I am so clumsy.</description>
<pubDate>Tue, 06 Sep 2011 15:54:51 +0000</pubDate>
<generator>http://wordpress.org/?v=MU</generator>
<language>en</language>
<wp:wxr_version>1.0</wp:wxr_version>
<wp:base_site_url>http://wordpress.com/</wp:base_site_url>
<wp:base_blog_url>http://ruprict.net</wp:base_blog_url>
<wp:category><wp:category_nicename>agile</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[Agile]]></wp:cat_name></wp:category>
<wp:category><wp:category_nicename>apple</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[Apple]]></wp:cat_name></wp:category>
<wp:category><wp:category_nicename>arcdeveloper</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[ArcDeveloper]]></wp:cat_name></wp:category>
<wp:category><wp:category_nicename>aspnet</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[ASP.NET]]></wp:cat_name></wp:category>
<wp:category><wp:category_nicename>castle</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[Castle]]></wp:cat_name></wp:category>
<wp:category><wp:category_nicename>continuous-integration</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[Continuous Integration]]></wp:cat_name></wp:category>
<wp:category><wp:category_nicename>flex</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[Flex]]></wp:cat_name></wp:category>
<wp:category><wp:category_nicename>javas</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[javas]]></wp:cat_name></wp:category>
<wp:category><wp:category_nicename>javascript</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[javascript]]></wp:cat_name></wp:category>
<wp:category><wp:category_nicename>mvc-aspnet</wp:category_nicename><wp:category_parent>ASP.NET</wp:category_parent><wp:cat_name><![CDATA[MVC]]></wp:cat_name></wp:category>
<wp:category><wp:category_nicename>os</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[OS]]></wp:cat_name></wp:category>
<wp:category><wp:category_nicename>recommendations</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[Recommendations]]></wp:cat_name></wp:category>
<wp:category><wp:category_nicename>ruby</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[Ruby]]></wp:cat_name></wp:category>
<wp:category><wp:category_nicename>uncategorized</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[Uncategorized]]></wp:cat_name></wp:category>
<wp:category><wp:category_nicename>wcf</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[WCF]]></wp:cat_name></wp:category>
<wp:category><wp:category_nicename>windsor</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[Windsor]]></wp:cat_name></wp:category>
<wp:category><wp:category_nicename>books-recommendations</wp:category_nicename><wp:category_parent>Recommendations</wp:category_parent><wp:cat_name><![CDATA[books]]></wp:cat_name></wp:category>
<wp:tag><wp:tag_slug>mt_keywords</wp:tag_slug><wp:tag_name><![CDATA[!$mt_keywords$!]]></wp:tag_name></wp:tag>
<wp:tag><wp:tag_slug>net</wp:tag_slug><wp:tag_name><![CDATA[.NET]]></wp:tag_name></wp:tag>
<wp:tag><wp:tag_slug>net-framework</wp:tag_slug><wp:tag_name><![CDATA[.NET Framework]]></wp:tag_name></wp:tag>
<wp:tag><wp:tag_slug>add-new-tag</wp:tag_slug><wp:tag_name><![CDATA[Add new tag]]></wp:tag_name></wp:tag>
<wp:tag><wp:tag_slug>agile</wp:tag_slug><wp:tag_name><![CDATA[Agile]]></wp:tag_name></wp:tag>
<wp:tag><wp:tag_slug>apple-2</wp:tag_slug><wp:tag_name><![CDATA[apple]]></wp:tag_name></wp:tag>
<wp:tag><wp:tag_slug>arcdeveloper</wp:tag_slug><wp:tag_name><![CDATA[ArcDeveloper]]></wp:tag_name></wp:tag>
<wp:tag><wp:tag_slug>arcgis-server</wp:tag_slug><wp:tag_name><![CDATA[ArcGIS Server]]></wp:tag_name></wp:tag>
<wp:tag><wp:tag_slug>arcgisserver</wp:tag_slug><wp:tag_name><![CDATA[ArcGISServer]]></wp:tag_name></wp:tag>
<wp:tag><wp:tag_slug>aspnet</wp:tag_slug><wp:tag_name><![CDATA[ASP.NET]]></wp:tag_name></wp:tag>
<wp:tag><wp:tag_slug>binsor</wp:tag_slug><wp:tag_name><![CDATA[Binsor]]></wp:tag_name></wp:tag>
<wp:tag><wp:tag_slug>books</wp:tag_slug><wp:tag_name><![CDATA[Books]]></wp:tag_name></wp:tag>
<wp:tag><wp:tag_slug>cairngorm-3</wp:tag_slug><wp:tag_name><![CDATA[Cairngorm 3]]></wp:tag_name></wp:tag>
<wp:tag><wp:tag_slug>castle</wp:tag_slug><wp:tag_name><![CDATA[Castle]]></wp:tag_name></wp:tag>
<wp:tag><wp:tag_slug>continuous-integration</wp:tag_slug><wp:tag_name><![CDATA[Continuous Integration]]></wp:tag_name></wp:tag>
<wp:tag><wp:tag_slug>continuous-integrationre</wp:tag_slug><wp:tag_name><![CDATA[Continuous IntegrationRE]]></wp:tag_name></wp:tag>
<wp:tag><wp:tag_slug>dojo</wp:tag_slug><wp:tag_name><![CDATA[Dojo]]></wp:tag_name></wp:tag>
<wp:tag><wp:tag_slug>esri</wp:tag_slug><wp:tag_name><![CDATA[ESRI]]></wp:tag_name></wp:tag>
<wp:tag><wp:tag_slug>flex</wp:tag_slug><wp:tag_name><![CDATA[Flex]]></wp:tag_name></wp:tag>
<wp:tag><wp:tag_slug>hyper-v</wp:tag_slug><wp:tag_name><![CDATA[Hyper-V]]></wp:tag_name></wp:tag>
<wp:tag><wp:tag_slug>javascript</wp:tag_slug><wp:tag_name><![CDATA[javascript]]></wp:tag_name></wp:tag>
<wp:tag><wp:tag_slug>json</wp:tag_slug><wp:tag_name><![CDATA[JSON]]></wp:tag_name></wp:tag>
<wp:tag><wp:tag_slug>lbs</wp:tag_slug><wp:tag_name><![CDATA[lbs]]></wp:tag_name></wp:tag>
<wp:tag><wp:tag_slug>monorail</wp:tag_slug><wp:tag_name><![CDATA[MonoRail]]></wp:tag_name></wp:tag>
<wp:tag><wp:tag_slug>mvc</wp:tag_slug><wp:tag_name><![CDATA[mvc]]></wp:tag_name></wp:tag>
<wp:tag><wp:tag_slug>nhibernate</wp:tag_slug><wp:tag_name><![CDATA[nhibernate]]></wp:tag_name></wp:tag>
<wp:tag><wp:tag_slug>powershell</wp:tag_slug><wp:tag_name><![CDATA[powershell]]></wp:tag_name></wp:tag>
<wp:tag><wp:tag_slug>remember-the-milk</wp:tag_slug><wp:tag_name><![CDATA[Remember The Milk]]></wp:tag_name></wp:tag>
<wp:tag><wp:tag_slug>repository</wp:tag_slug><wp:tag_name><![CDATA[repository]]></wp:tag_name></wp:tag>
<wp:tag><wp:tag_slug>rest</wp:tag_slug><wp:tag_name><![CDATA[REST]]></wp:tag_name></wp:tag>
<wp:tag><wp:tag_slug>robotlegs</wp:tag_slug><wp:tag_name><![CDATA[robotlegs]]></wp:tag_name></wp:tag>
<wp:tag><wp:tag_slug>ruby</wp:tag_slug><wp:tag_name><![CDATA[Ruby]]></wp:tag_name></wp:tag>
<wp:tag><wp:tag_slug>tools</wp:tag_slug><wp:tag_name><![CDATA[Tools]]></wp:tag_name></wp:tag>
<wp:tag><wp:tag_slug>unit-of-work</wp:tag_slug><wp:tag_name><![CDATA[unit of work]]></wp:tag_name></wp:tag>
<wp:tag><wp:tag_slug>unit-testing</wp:tag_slug><wp:tag_name><![CDATA[Unit testing]]></wp:tag_name></wp:tag>
<wp:tag><wp:tag_slug>virtual-earth</wp:tag_slug><wp:tag_name><![CDATA[Virtual Earth]]></wp:tag_name></wp:tag>
<wp:tag><wp:tag_slug>wcf</wp:tag_slug><wp:tag_name><![CDATA[WCF]]></wp:tag_name></wp:tag>
<wp:tag><wp:tag_slug>windsor</wp:tag_slug><wp:tag_name><![CDATA[Windsor]]></wp:tag_name></wp:tag>
<generator>http://wordpress.com/</generator>
<cloud domain='ruprict.net' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
<url>http://1.gravatar.com/blavatar/79a9d617340d150e9dfd7ae02445cfb7?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
<title>Fumbling Towards Geekstacy</title>
<link>http://ruprict.net</link>
</image>
<atom:link rel="search" type="application/opensearchdescription+xml" href="http://ruprict.net/osd.xml" title="Fumbling Towards Geekstacy" />
<atom:link rel='hub' href='http://ruprict.net/?pushpress=hub'/>
<item>
<title>ArcGIS Server Javascript API Gotcha: Identify</title>
<link>http://ruprict.net/?p=96</link>
<pubDate>Wed, 30 Nov -0001 00:00:00 +0000</pubDate>
<dc:creator><![CDATA[Ruprict]]></dc:creator>
<guid isPermaLink="false">http://ruprict.wordpress.com/?p=96</guid>
<description></description>
<content:encoded><![CDATA[I ran into an odd problem after I installed SP1 with a site using the ArcGIS Server javascript API.  Basically, the identify task broke in IE only.  All was well in <a class="zem_slink" title="Mozilla Firefox" rel="geolocation" href="http://maps.google.com/maps?ll=45.1238,-123.1138&amp;spn=1.0,1.0&amp;q=45.1238,-123.1138%20%28Mozilla%20Firefox%29&amp;t=h">Firefox</a>, so I was stumped, as I didn't receive any error messages.  So, I cranked open <a href="http://www.fiddlertool.com/fiddler/" target="_blank">Fidder </a>which revealed that the HTTP request was never happening.  Strange, I thought, so I copied the HTTP request that was working in Firefox from the <a class="zem_slink" title="Firebug (Firefox extension)" rel="wikipedia" href="http://en.wikipedia.org/wiki/Firebug_%28Firefox_extension%29">Firebug</a> Net tab and pasted it into the IE address bar, yet it wouldn't let me paste the whole URL.  So, the URL was too long...but why?  As it turns out the <a href="http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/arcgis/help/jsapi_start.htm" target="_blank">IdentifyParameters </a>use a geometry, and that geometry has a spatialReference, which comes from the map.  The spatialReference we use is WKID 2913, which is one of the Oregon State Plane projected systems.   When the API sets this value on the javascript map object, it uses the Well-Known Text (WKT) version, which is a REALLY long string.  So, I overwrite the spatialReference on the geometry before executing the identify task with a light object that just has the WKID.  Like so:
<pre>        
funciton doIdentify(evt){</pre>
<div id="df" class="ArwC7c ckChnd">
<pre>
       this.taskParameters.mapExtent=this.map.extent;
       // have to do this in order to make this work in IE.
       // otherwise the AGS jsapi will post the WKT which makes the
URL too long.
       this.taskParameters.geometry.spatialReference={wkid:2913,toJson:function(){return
'{"wkid":"2913"}';}};
       if (this.options.notifier){
           this.options.notifier.ShowLoading("Identifying...",0);
       }
       esriConfig.defaults.io.postLength=100000;</pre>
<pre>
       dojo.forEach(this.map.services,dojo.hitch(this,function(serv){
           if (serv.Name.indexOf("Aerial")===-1){
               var task = new esri.tasks.IdentifyTask(serv.URL);
               this.taskParameters.height=this.map.height;
               this.taskParameters.width=this.map.width;</pre>
<pre></pre>
<pre>
task.execute(this.taskParameters,dojo.hitch(this,this._identifyResults));
           }
       }));
       dojo.publish("/esi/identify/lastservice");
   },</pre>
</div>
<div class="zemanta-pixie" style="margin-top:10px;height:15px;"><a class="zemanta-pixie-a" title="Zemified by Zemanta" href="http://reblog.zemanta.com/zemified/541f258e-de77-4bdc-a076-611ce3c749bd/"><img class="zemanta-pixie-img" style="border:medium none;float:right;" src="http://img.zemanta.com/reblog_e.png?x-id=541f258e-de77-4bdc-a076-611ce3c749bd" alt="Reblog this post [with Zemanta]" /></a></div>]]></content:encoded>
<excerpt:encoded><![CDATA[]]></excerpt:encoded>
<wp:post_id>96</wp:post_id>
<wp:post_date>2008-11-18 02:54:46</wp:post_date>
<wp:post_date_gmt>0000-00-00 00:00:00</wp:post_date_gmt>
<wp:comment_status>open</wp:comment_status>
<wp:ping_status>open</wp:ping_status>
<wp:post_name></wp:post_name>
<wp:status>draft</wp:status>
<wp:post_parent>0</wp:post_parent>
<wp:menu_order>0</wp:menu_order>
<wp:post_type>post</wp:post_type>
<wp:post_password></wp:post_password>
<wp:is_sticky>0</wp:is_sticky>
<wp:postmeta>
<wp:meta_key>_edit_last</wp:meta_key>
<wp:meta_value><![CDATA[3307217]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_edit_lock</wp:meta_key>
<wp:meta_value><![CDATA[1226958887]]></wp:meta_value>
</wp:postmeta>
</item>
<item>
<title>Auto Draft</title>
<link>http://ruprict.net/?p=350</link>
<pubDate>Wed, 30 Nov -0001 00:00:00 +0000</pubDate>
<dc:creator><![CDATA[Ruprict]]></dc:creator>
<guid isPermaLink="false">http://ruprict.net/?p=350</guid>
<description></description>
<content:encoded><![CDATA[]]></content:encoded>
<excerpt:encoded><![CDATA[]]></excerpt:encoded>
<wp:post_id>350</wp:post_id>
<wp:post_date>2011-09-13 16:05:53</wp:post_date>
<wp:post_date_gmt>0000-00-00 00:00:00</wp:post_date_gmt>
<wp:comment_status>open</wp:comment_status>
<wp:ping_status>open</wp:ping_status>
<wp:post_name></wp:post_name>
<wp:status>auto-draft</wp:status>
<wp:post_parent>0</wp:post_parent>
<wp:menu_order>0</wp:menu_order>
<wp:post_type>post</wp:post_type>
<wp:post_password></wp:post_password>
<wp:is_sticky>0</wp:is_sticky>
</item>
<item>
<title>Auto Draft</title>
<link>http://ruprict.net/?p=349</link>
<pubDate>Wed, 30 Nov -0001 00:00:00 +0000</pubDate>
<dc:creator><![CDATA[Ruprict]]></dc:creator>
<guid isPermaLink="false">http://ruprict.net/?p=349</guid>
<description></description>
<content:encoded><![CDATA[]]></content:encoded>
<excerpt:encoded><![CDATA[]]></excerpt:encoded>
<wp:post_id>349</wp:post_id>
<wp:post_date>2011-09-06 20:58:04</wp:post_date>
<wp:post_date_gmt>0000-00-00 00:00:00</wp:post_date_gmt>
<wp:comment_status>open</wp:comment_status>
<wp:ping_status>open</wp:ping_status>
<wp:post_name></wp:post_name>
<wp:status>auto-draft</wp:status>
<wp:post_parent>0</wp:post_parent>
<wp:menu_order>0</wp:menu_order>
<wp:post_type>post</wp:post_type>
<wp:post_password></wp:post_password>
<wp:is_sticky>0</wp:is_sticky>
</item>
<item>
<title>ArcDeveloper ArcGIS Server REST API is Breathing!</title>
<link>http://ruprict.net/2008/03/05/arcdeveloper-rest-intro/</link>
<pubDate>Wed, 05 Mar 2008 22:10:29 +0000</pubDate>
<dc:creator><![CDATA[Ruprict]]></dc:creator>
<category domain="tag"><![CDATA[ArcDeveloper]]></category>
<category domain="tag" nicename="arcdeveloper"><![CDATA[ArcDeveloper]]></category>
<category><![CDATA[ArcDeveloper]]></category>
<category domain="category" nicename="arcdeveloper"><![CDATA[ArcDeveloper]]></category>
<category domain="tag"><![CDATA[ArcGIS Server]]></category>
<category domain="tag" nicename="arcgis-server"><![CDATA[ArcGIS Server]]></category>
<category domain="tag"><![CDATA[REST]]></category>
<category domain="tag" nicename="rest"><![CDATA[REST]]></category>
<guid isPermaLink="false">http://ruprict.wordpress.com/2008/03/05/hello-world/</guid>
<description></description>
<content:encoded><![CDATA[So, the <a href="http://www.spatiallyadjusted.com/2008/01/30/esris-web-adf-is-one-horrific-development-platform/">angst</a> around the ArcGIS Server Web ADF is well known and I shan't rehash it here (OK, just a little rehashing: the ADF is a bloated sack of vomit) but, rather, I'll point you to the beginnings of an open source ArcGIS Server REST API (<a href="http://svn2.assembla.com/svn/arcdeveloper/ArcDeveloper.REST/">svn</a>) at ArcDeveloper.NET. The project is very young (and always looking for contributors) and, in it's current state, has the following capabilities:
<ul>
<li> You can query single features by id (must be OBJECTID, ugh)</li>
<li>You can query features with a where clause</li>
<li>You can query features with a bbox (AND a where clause, if you want)</li>
</ul>
In this post, I will walk through what it takes to set it up and point it at one of your ArcGIS Server services.
<h3>What You'll Need</h3>
Visual Studio 2008, implying .NET 3.5. You will have to build the solution, as we haven't made an official release yet.
Optionally, I would have <a href="http://www.fiddler2.com/fiddler2/" target="_blank">Fiddler</a>, <a href="http://getfirebug.com" target="_blank">Firebug</a>, and <a href="http://www.codeplex.com/JsonViewerhttp://www.codeplex.com/JsonViewer" target="_blank">JSONViewer</a>.
<h3>Step 1: Get the source</h3>
Using <a href="http://tortoisesvn.tigris.org/">TortoiseSVN</a> (or the svn client of your choosing), perform a checkout of the trunk (http://svn2.assembla.com/svn/arcdeveloper/ArcDeveloper.REST/trunk/)
<h3>Step 2: Open the solution</h3>
In the "Product" directory, you'll find the VS2008 solution file. Like, open it or something. It consists of 5 projects, 2 of which are test projects. The other projects are the core interfaces and services, with the last one being a web project to show how to publish the REST service with WCF and a demo web page.
<h3>Step 3: Build the solution</h3>
Uh, in VS2008, select "Build Solution..."
<h4>Step 4: Use Dave's Stuff</h4>
So Dave Bouwman, who I think is just the cat's pajamas, has the demo site using an ArcGIS Server map service that he has been generous enough to provide. If you look in the ArcDeveloper.REST.Web project, you'll find a config directory. Opening up the components.config file will show where the endpoint of the map services is specified. Looks alot like:
<div style="background:white none repeat scroll 0 50%;font-family:Courier New;font-size:8pt;color:black;overflow:scroll;">
<p style="margin:0;"><span style="color:blue;">&lt;</span><span style="color:#a31515;">component</span><span style="color:blue;"> </span><span style="color:red;">id</span><span style="color:blue;">=</span>"<span style="color:blue;">ags.service</span>"<span style="color:blue;"> </span><span style="color:red;">lifestyle</span><span style="color:blue;">=</span>"<span style="color:blue;">pooled</span>"<span style="color:blue;"> </span><span style="color:red;">initialPoolSize</span><span style="color:blue;">=</span>"<span style="color:blue;">2</span>"<span style="color:blue;"> </span><span style="color:red;">maxPoolSize</span><span style="color:blue;">=</span>"<span style="color:blue;">2</span>"<span style="color:blue;"> </span></p>
<p style="margin:0;"><span style="color:blue;"> </span><span style="color:red;">service</span><span style="color:blue;">=</span>"<span style="color:blue;">ArcDeveloper.REST.Core.Interfaces.IRESTService, ArcDeveloper.REST.Core</span>"</p>
<p style="margin:0;"><span style="color:blue;"> </span><span style="color:red;">type</span><span style="color:blue;">=</span>"<span style="color:blue;">ArcDeveloper.REST.ArcGIS.AGSMapService, ArcDeveloper.REST.ArcGIS</span>"<span style="color:blue;">&gt;</span></p>
<p style="margin:0;"><span style="color:blue;"> &lt;</span><span style="color:#a31515;">parameters</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0;"><span style="color:blue;"> </span><span style="color:#a31515;">&lt;name</span><span style="color:blue;">&gt;</span>TestService<span style="color:blue;">&lt;/</span><span style="color:#a31515;">name</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0;"><span style="color:blue;"> &lt;</span><span style="color:#a31515;">description</span><span style="color:blue;">&gt;</span>Base map<span style="color:blue;">&lt;/</span><span style="color:#a31515;">description</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0;"><span style="color:blue;"> &lt;</span><span style="color:#a31515;">connectionString</span><span style="color:blue;">&gt;</span>http://65.101.234.201/arcgis/services/gains/gains/MapServer<span style="color:blue;">&lt;/</span><span style="color:#a31515;">connectionString</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0;"><span style="color:blue;"> &lt;/</span><span style="color:#a31515;">parameters</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0;"><span style="color:blue;">&lt;/</span><span style="color:#a31515;">component</span><span style="color:blue;">&gt;</span></p>
</div>
Do you see the cool &lt;connectionString&gt; parameter? That's Daves AGS service (I told you he was cool.) Run the site (it uses the VS Dev server now) and click "Load Polygon". You'll see a small polygon drawn over Yemen (erm, at least I think that is Yemen). Change the ID and draw some more.
<a href="http://ruprict.files.wordpress.com/2008/03/croppercapture10.png" title="ArcDeveloper REST API Demo Page"><img src="http://ruprict.files.wordpress.com/2008/03/croppercapture10.thumbnail.png" alt="ArcDeveloper REST API Demo Page" /></a>
Here's what is happening:
A HTTP GET is issued to the local web service with a URI that looks alot like:
<pre style="overflow:scroll;"> http://localhost:xxxx/rest.svc/TestService/Flyways/10?g=true</pre>
Let's break down the URI, shall we? Starting with rest.svc, that is the WCF endpoint for the REST service. "TestService" points to our configuration (from above) file and tells the service which map we want to use. "Flyways" is the name of a layer in Dave's service. "10" is the id of the feature we want, and "g=true" tells the service to return the geometry (there are cases where you don't want that, b/c it can make the size of the response baloon pretty quickly.) So, that is pretty RESTy, yes?
The response from that HTTP GET looks like:
<div class="netInfoResponseText netInfoText" style="border:thin dotted black;background:#cccccc none repeat scroll 0 50%;overflow:scroll;">
<pre>{ "type": "Feature","geometry": {"type": "Polygon",
"coordinates": [
[
[ 44.3231, 14.2555], [43.2827,13.6294],[ 43.285, 13.6503], (...lots more coords...) ]
},
"properties": {
"Ssp": "maculosus",
"Species": "Burhinus capensis",
"Shape_Length": "4.59630121045653",
"TSN": "0",
"extent": "42.9447173339071,13.6294196034485,44.3230947030963,15.0950604545328",
"SpeciesCod": "BURCA",
"WISDOM_SpeciesID": "557",
"OBJECTID": "10",
"Code": " ",
"Shape.area": "1.28930099595786"
}
}</pre>
</div>
Which is valid <a href="http://www.geojson.org" target="_blank">GeoJson</a>. Neat, eh?
I know what you are saying. "Glenn, why would I use this when ArcGIS Server 9.3 will have a REST API?? HMMM?" Well, that is a great question. The only answer I have is that you can use this now, contribute to it, and make the world a better place. Also, you can learn about a lot of stuff, like REST, WCF, GeoJSON, AJAX, the <a href="http://www.castleproject.org" target="_blank">Castle Project </a>stuff, and much, much more. Plus, there are some real brains on this project (I am not one of them) so you can sop up their wisdom as well. Also, I heard a nasty rumor that the AGS REST API wasn't using GeoJSON, but a proprietary spatial JSON format, which is a bit disconcerting, if not totally expected.
In future posts I'll break down the ArcDeveloper REST API architecture, showing how you can write your own providers and formatters. We still have a TON of work to do on it, but we're on our way.]]></content:encoded>
<excerpt:encoded><![CDATA[]]></excerpt:encoded>
<wp:post_id>1</wp:post_id>
<wp:post_date>2008-03-05 22:10:29</wp:post_date>
<wp:post_date_gmt>2008-03-05 22:10:29</wp:post_date_gmt>
<wp:comment_status>open</wp:comment_status>
<wp:ping_status>open</wp:ping_status>
<wp:post_name>arcdeveloper-rest-intro</wp:post_name>
<wp:status>publish</wp:status>
<wp:post_parent>0</wp:post_parent>
<wp:menu_order>0</wp:menu_order>
<wp:post_type>post</wp:post_type>
<wp:post_password></wp:post_password>
<wp:is_sticky>0</wp:is_sticky>
<wp:postmeta>
<wp:meta_key>_wp_old_slug</wp:meta_key>
<wp:meta_value><![CDATA[hello-world]]></wp:meta_value>
</wp:postmeta>
</item>
<item>
<title>About</title>
<link>http://ruprict.net/about/</link>
<pubDate>Wed, 05 Mar 2008 22:10:29 +0000</pubDate>
<dc:creator><![CDATA[Ruprict]]></dc:creator>
<category><![CDATA[Uncategorized]]></category>
<category domain="category" nicename="uncategorized"><![CDATA[Uncategorized]]></category>
<guid isPermaLink="false"></guid>
<description></description>
<content:encoded><![CDATA[I am a nerd living among NASCAR fans in Charlotte. I have been working in GIS for about a decade, and with .NET since it's inception. I have somewhere between 2 and 5 children and a wife that must've lost a bet. If there is some reason you'd need to contact me, you can hit me <a href="mailto:glenn_goodrich@hotmail.com"> here. </a> I hope you find something useful or amusing or amusingly useful while you are here.]]></content:encoded>
<excerpt:encoded><![CDATA[]]></excerpt:encoded>
<wp:post_id>2</wp:post_id>
<wp:post_date>2008-03-05 22:10:29</wp:post_date>
<wp:post_date_gmt>2008-03-05 22:10:29</wp:post_date_gmt>
<wp:comment_status>open</wp:comment_status>
<wp:ping_status>open</wp:ping_status>
<wp:post_name>about</wp:post_name>
<wp:status>publish</wp:status>
<wp:post_parent>0</wp:post_parent>
<wp:menu_order>2</wp:menu_order>
<wp:post_type>page</wp:post_type>
<wp:post_password></wp:post_password>
<wp:is_sticky>0</wp:is_sticky>
<wp:postmeta>
<wp:meta_key>_edit_lock</wp:meta_key>
<wp:meta_value><![CDATA[1224116906]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_edit_last</wp:meta_key>
<wp:meta_value><![CDATA[3307217]]></wp:meta_value>
</wp:postmeta>
<wp:comment>
<wp:comment_id>457</wp:comment_id>
<wp:comment_author><![CDATA[hyips]]></wp:comment_author>
<wp:comment_author_email>Picchetti@gmail.com</wp:comment_author_email>
<wp:comment_author_url>http://libertyreserveos.com/</wp:comment_author_url>
<wp:comment_author_IP>173.208.12.215</wp:comment_author_IP>
<wp:comment_date>2011-09-08 05:20:54</wp:comment_date>
<wp:comment_date_gmt>2011-09-08 00:20:54</wp:comment_date_gmt>
<wp:comment_content><![CDATA[Appreciate it for sharing About Fumbling Towards Geekstacy with us keep update bro love your article about About Fumbling Towards Geekstacy .]]></wp:comment_content>
<wp:comment_approved>spam</wp:comment_approved>
<wp:comment_type></wp:comment_type>
<wp:comment_parent>0</wp:comment_parent>
<wp:comment_user_id>0</wp:comment_user_id>
</wp:comment>
<wp:comment>
<wp:comment_id>456</wp:comment_id>
<wp:comment_author><![CDATA[cut the rope cheats]]></wp:comment_author>
<wp:comment_author_email>Providence@gmail.com</wp:comment_author_email>
<wp:comment_author_url>http://pandroidmarket.blogspot.com/2011/08/cut-rope-cut-rope-apk-or-cut-rope-game.html</wp:comment_author_url>
<wp:comment_author_IP>173.208.12.215</wp:comment_author_IP>
<wp:comment_date>2011-09-08 05:20:54</wp:comment_date>
<wp:comment_date_gmt>2011-09-08 00:20:54</wp:comment_date_gmt>
<wp:comment_content><![CDATA[Appreciate it for sharing About Fumbling Towards Geekstacy with us keep update bro love your article about About Fumbling Towards Geekstacy .]]></wp:comment_content>
<wp:comment_approved>spam</wp:comment_approved>
<wp:comment_type></wp:comment_type>
<wp:comment_parent>0</wp:comment_parent>
<wp:comment_user_id>0</wp:comment_user_id>
</wp:comment>
<wp:comment>
<wp:comment_id>463</wp:comment_id>
<wp:comment_author><![CDATA[birthday cards]]></wp:comment_author>
<wp:comment_author_email>97352Ozog@gmail.com</wp:comment_author_email>
<wp:comment_author_url>http://ebirthdayquotes.blogspot.com/</wp:comment_author_url>
<wp:comment_author_IP>173.208.66.214</wp:comment_author_IP>
<wp:comment_date>2011-09-12 08:53:09</wp:comment_date>
<wp:comment_date_gmt>2011-09-12 03:53:09</wp:comment_date_gmt>
<wp:comment_content><![CDATA[I like Your Article about About Fumbling Towards Geekstacy Perfect just what I was looking for! .]]></wp:comment_content>
<wp:comment_approved>spam</wp:comment_approved>
<wp:comment_type></wp:comment_type>
<wp:comment_parent>0</wp:comment_parent>
<wp:comment_user_id>0</wp:comment_user_id>
</wp:comment>
</item>
<item>
<title>ArcDeveloper REST API Demo Page</title>
<link>http://ruprict.net/2008/03/05/arcdeveloper-rest-intro/arcdeveloper-rest-api-demo-page/</link>
<pubDate>Thu, 06 Mar 2008 14:21:54 +0000</pubDate>
<dc:creator><![CDATA[Ruprict]]></dc:creator>
<category><![CDATA[Uncategorized]]></category>
<category domain="category" nicename="uncategorized"><![CDATA[Uncategorized]]></category>
<guid isPermaLink="false">http://ruprict.files.wordpress.com/2008/03/croppercapture10.png</guid>
<description></description>
<content:encoded><![CDATA[Look at Yemen! (It's next to Africa and under Saudi Arabia)]]></content:encoded>
<excerpt:encoded><![CDATA[]]></excerpt:encoded>
<wp:post_id>4</wp:post_id>
<wp:post_date>2008-03-06 19:21:54</wp:post_date>
<wp:post_date_gmt>2008-03-06 14:21:54</wp:post_date_gmt>
<wp:comment_status>open</wp:comment_status>
<wp:ping_status>open</wp:ping_status>
<wp:post_name>arcdeveloper-rest-api-demo-page</wp:post_name>
<wp:status>inherit</wp:status>
<wp:post_parent>1</wp:post_parent>
<wp:menu_order>0</wp:menu_order>
<wp:post_type>attachment</wp:post_type>
<wp:post_password></wp:post_password>
<wp:is_sticky>0</wp:is_sticky>
<wp:attachment_url>http://ruprict.files.wordpress.com/2008/03/croppercapture10.png</wp:attachment_url>
<wp:postmeta>
<wp:meta_key>_wp_attached_file</wp:meta_key>
<wp:meta_value><![CDATA[/home/wpcom/public_html/wp-content/blogs.dir/65b/3073262/files/2008/03/croppercapture10.png]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_wp_attachment_metadata</wp:meta_key>
<wp:meta_value><![CDATA[a:6:{s:5:"width";i:933;s:6:"height";i:638;s:14:"hwstring_small";s:23:"height='87' width='128'";s:4:"file";s:91:"/home/wpcom/public_html/wp-content/blogs.dir/65b/3073262/files/2008/03/croppercapture10.png";s:5:"thumb";s:30:"croppercapture10.thumbnail.png";s:10:"image_meta";a:10:{s:8:"aperture";i:0;s:6:"credit";s:0:"";s:6:"camera";s:0:"";s:7:"caption";s:0:"";s:17:"created_timestamp";i:0;s:9:"copyright";s:0:"";s:12:"focal_length";i:0;s:3:"iso";i:0;s:13:"shutter_speed";i:0;s:5:"title";s:0:"";}}]]></wp:meta_value>
</wp:postmeta>
</item>
<item>
<title>ArcDeveloper REST: U R I and I R U</title>
<link>http://ruprict.net/2008/03/08/arcdeveloper-rest-u-r-i-and-i-r-u/</link>
<pubDate>Sat, 08 Mar 2008 00:37:12 +0000</pubDate>
<dc:creator><![CDATA[Ruprict]]></dc:creator>
<category><![CDATA[ArcDeveloper]]></category>
<category domain="category" nicename="arcdeveloper"><![CDATA[ArcDeveloper]]></category>
<category domain="tag"><![CDATA[REST]]></category>
<category domain="tag" nicename="rest"><![CDATA[REST]]></category>
<guid isPermaLink="false">http://ruprict.wordpress.com/?p=5</guid>
<description></description>
<content:encoded><![CDATA[As I promised in my (first and) previous post, I am gonna quickly go over the very simple architecture of the ArcDeveloper REST API. This post covers how we expose our REST endpoint(s).
At a high level, we wanted to expose a single <a href="http://en.wikipedia.org/wiki/Representational_State_Transfer" target="_blank">REST</a> endpoint that allowed the caller to specify the "service", "layer", and query parameters in order to get geographic features returned in a format, which is also specified by the caller. So, attempting to be as RESTy as possible, the URI looks like:
<pre style="font-size:small;"> http://&lt;yourServer&gt;/rest.svc/service/layer/3?format=geojson</pre>
It's clear and easy and other URI endpoints are easy to deduce. Yup, we are RESTing we the best of them. Our main endpoint is the rest.svc, which is WCF's way of exposing a service endpoint. The first question, then, we had to answer was how we would handle the URI routing. If the map services are registered dynamically (using Castle Windsor, which is arguably the greatest piece of code ever written. Ever. Not that I am prone to hyperbole. Oh, I'll cover the configuration in the next post) then we have to dissect the various pieces of the URI to:
<ol>
<li>Get a hold of the service requested.</li>
<li>Query the right layer</li>
<li>Use the right query parameters.</li>
<li>Grab the right formatter.</li>
</ol>
Luckily for us, .NET 3.5 had recently been released, incorporating some cool changes in <a href="http://msdn2.microsoft.com/en-us/library/ms731082.aspx" target="_blank">WCF</a>, the coolest one being the URITemplate (good background <a href="http://msdn2.microsoft.com/en-us/magazine/cc135976.aspx" target="_blank">here</a>). The URITemplate allows us to define URI templates (duh) and map them to service methods (or OperationContracts, in WCF-speak) complete with the mapping of parameters of the method. Let's see how we are using this now:
<div style="overflow:scroll;background:white none repeat scroll 0 50%;font-family:Courier New;font-size:8pt;color:black;">
<p style="margin:0;"> [<span style="color:#2b91af;">OperationContract</span>]</p>
<p style="margin:0;"> [<span style="color:#2b91af;">WebGet</span>(UriTemplate=<span style="color:#a31515;">"{serviceName}/{featureType}/{featureId}?g={geom}"</span>,ResponseFormat=<span style="color:#2b91af;">WebMessageFormat</span>.Json)]</p>
<p style="margin:0;"> <span style="color:#2b91af;">Stream</span> GetSingleFeatureJSON(<span style="color:blue;">string</span> serviceName, <span style="color:blue;">string</span> featureType, <span style="color:blue;">string</span> featureId, <span style="color:blue;">bool</span> geom);</p>
</div>
You can see how the dealies in the "{}" get mapped to the method parameters. Just to be complete, {serviceName} maps to the serviceName parameter, etc. The "geom" parameter specifies whether or not you want all the coordinates returned, because sometimes that can be a LOT of data. We also specify the response format here and the HTTP verb (WebGet== HTTP Get. I'll give you 3 guesses how you specify HTTP POST. Wrong. It's <a href="http://msdn2.microsoft.com/en-us/library/system.servicemodel.web.webinvokeattribute.aspx" target="_blank">WebInvoke</a>.)
So, I know what you are saying. "WTF? You have hard-coded the format INTO THE BLOODY METHOD NAME! I am not reading any more of this tripe." Well, that's your prerogative (Tangent: I had NO idea that was how to spell that word. No wonder Bobby Brown is on drugs) but know that I am adhering to the Last Responsible Minute (LRM) doctrine. We only need (geo)JSON right now, meaning, no one has written any other formatters. Once we have another format, we'll put in a "format" parameter, remove the ResponseFormat and life will be all good. Weak excuse, you say? Maybe. Let's, uh, move on.
The URIs the project currently supports are:
<div style="border:thin dotted black;background:#cccccc none repeat scroll 0 50%;overflow:scroll;">
<pre> http://yourserver/rest.svc/services</pre>
</div>
Will return information about all of the services that are available to be queried.
<div style="border:thin dotted black;background:#cccccc none repeat scroll 0 50%;overflow:scroll;">
<pre> http://yourserver/rest.svc/serviceName/layerName/OBJECTID?g=true</pre>
</div>
Will return the feature corresponding to the OBJECTID value from the layer specified by "layerName" in the service configured as "serviceName".
<div style="border:thin dotted black;background:#cccccc none repeat scroll 0 50%;overflow:scroll;">
<pre> http://yourserver/rest.svc/serviceName/layerName?query=whereClause&amp;bbox=xmin,ymin,xmax,ymax&amp;g=true</pre>
</div>
Will query layer named "layerName" in service configured as "serviceName" using the value in "whereClause" (like height&gt;100 or streetname='Main' -- don't forget to <a href="http://www.asciitable.com/" target="_blank">escape</a> your querystrings....) inside the bounding box specified by xmin, ymin and xmax, ymax.
As always, g=true returns the full coordinates of each geometry. Also, the serviceName corresponds to the name given in the Windsor configuration, NOT the name of the ArcGIS Server service.
In the next post (hopefully) I'll cover the service and its configuration, showing you how we leverage the total kick-assness of Windsor to make life easy.]]></content:encoded>
<excerpt:encoded><![CDATA[]]></excerpt:encoded>
<wp:post_id>5</wp:post_id>
<wp:post_date>2008-03-08 05:37:12</wp:post_date>
<wp:post_date_gmt>2008-03-08 00:37:12</wp:post_date_gmt>
<wp:comment_status>open</wp:comment_status>
<wp:ping_status>open</wp:ping_status>
<wp:post_name>arcdeveloper-rest-u-r-i-and-i-r-u</wp:post_name>
<wp:status>publish</wp:status>
<wp:post_parent>0</wp:post_parent>
<wp:menu_order>0</wp:menu_order>
<wp:post_type>post</wp:post_type>
<wp:post_password></wp:post_password>
<wp:is_sticky>0</wp:is_sticky>
<wp:comment>
<wp:comment_id>2</wp:comment_id>
<wp:comment_author><![CDATA[Brian Flood]]></wp:comment_author>
<wp:comment_author_email>bFlood@spatialdatalogic.com</wp:comment_author_email>
<wp:comment_author_url>http://www.spatialdatalogic.com/cs/blogs/brian_flood</wp:comment_author_url>
<wp:comment_author_IP>12.144.53.5</wp:comment_author_IP>
<wp:comment_date>2008-03-11 00:13:34</wp:comment_date>
<wp:comment_date_gmt>2008-03-10 19:13:34</wp:comment_date_gmt>
<wp:comment_content><![CDATA[this is great stuff glen, keep up the good work]]></wp:comment_content>
<wp:comment_approved>1</wp:comment_approved>
<wp:comment_type></wp:comment_type>
<wp:comment_parent>0</wp:comment_parent>
<wp:comment_user_id>0</wp:comment_user_id>
</wp:comment>
</item>
<item>
<title>High Level Architecture of ArcDeveloper REST API</title>
<link>http://ruprict.net/2008/03/11/arcdeveloper-rest-windsor-brings-the-party-that-rocks-the-body/high-level-architecture-of-arcdeveloper-rest-api/</link>
<pubDate>Mon, 10 Mar 2008 21:11:50 +0000</pubDate>
<dc:creator><![CDATA[Ruprict]]></dc:creator>
<category><![CDATA[Uncategorized]]></category>
<category domain="category" nicename="uncategorized"><![CDATA[Uncategorized]]></category>
<guid isPermaLink="false">http://ruprict.files.wordpress.com/2008/03/croppercapture1.png</guid>
<description></description>
<content:encoded><![CDATA[Basically, we expose a WCF Service that implements IRESTServiceManager and contains Services and Formatters. The client can request the service and formatter in the URI of the REST query.]]></content:encoded>
<excerpt:encoded><![CDATA[]]></excerpt:encoded>
<wp:post_id>7</wp:post_id>
<wp:post_date>2008-03-11 02:11:50</wp:post_date>
<wp:post_date_gmt>2008-03-10 21:11:50</wp:post_date_gmt>
<wp:comment_status>open</wp:comment_status>
<wp:ping_status>open</wp:ping_status>
<wp:post_name>high-level-architecture-of-arcdeveloper-rest-api</wp:post_name>
<wp:status>inherit</wp:status>
<wp:post_parent>6</wp:post_parent>
<wp:menu_order>0</wp:menu_order>
<wp:post_type>attachment</wp:post_type>
<wp:post_password></wp:post_password>
<wp:is_sticky>0</wp:is_sticky>
<wp:attachment_url>http://ruprict.files.wordpress.com/2008/03/croppercapture1.png</wp:attachment_url>
<wp:postmeta>
<wp:meta_key>_wp_attached_file</wp:meta_key>
<wp:meta_value><![CDATA[/home/wpcom/public_html/wp-content/blogs.dir/65b/3073262/files/2008/03/croppercapture1.png]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_wp_attachment_metadata</wp:meta_key>
<wp:meta_value><![CDATA[a:6:{s:5:"width";i:490;s:6:"height";i:408;s:14:"hwstring_small";s:23:"height='96' width='115'";s:4:"file";s:90:"/home/wpcom/public_html/wp-content/blogs.dir/65b/3073262/files/2008/03/croppercapture1.png";s:5:"thumb";s:29:"croppercapture1.thumbnail.png";s:10:"image_meta";a:10:{s:8:"aperture";i:0;s:6:"credit";s:0:"";s:6:"camera";s:0:"";s:7:"caption";s:0:"";s:17:"created_timestamp";i:0;s:9:"copyright";s:0:"";s:12:"focal_length";i:0;s:3:"iso";i:0;s:13:"shutter_speed";i:0;s:5:"title";s:0:"";}}]]></wp:meta_value>
</wp:postmeta>
</item>
<item>
<title>ArcDeveloper REST: Windsor Brings the Party That Rocks the Body</title>
<link>http://ruprict.net/2008/03/11/arcdeveloper-rest-windsor-brings-the-party-that-rocks-the-body/</link>
<pubDate>Mon, 10 Mar 2008 21:53:09 +0000</pubDate>
<dc:creator><![CDATA[Ruprict]]></dc:creator>
<category domain="tag"><![CDATA[ArcDeveloper]]></category>
<category domain="tag" nicename="arcdeveloper"><![CDATA[ArcDeveloper]]></category>
<category><![CDATA[ArcDeveloper]]></category>
<category domain="category" nicename="arcdeveloper"><![CDATA[ArcDeveloper]]></category>
<category domain="tag"><![CDATA[REST]]></category>
<category domain="tag" nicename="rest"><![CDATA[REST]]></category>
<guid isPermaLink="false">http://ruprict.wordpress.com/?p=6</guid>
<description></description>
<content:encoded><![CDATA[
<div style="border:thin solid #cccccc;background:#cccccc none repeat scroll 0 50%;color:#ffffff;"> NOTE: <a href="http://blog.davebouwman.net/" target="_blank">Dave</a> has blogged about the REST API, including a <a href="http://blog.davebouwman.net/" target="_blank">demo</a> of it in action! Check it out!</div>
In part III of my series on the ArcDeveloper REST API, I want to focus on how we use <a href="http://www.castleproject.org/container/index.html" target="_blank">Windsor </a>to configure the service. The best way to to that is to take a step back and look at why Windsor exists. Windsor is an <a href="http://www.martinfowler.com/articles/injection.html" target="_blank">Inversion of Control</a> (IoC) container that provides a robust Dependency Injection (DI) framework. Both of those phrases have been blogged about by just about every human in existence, so if the Fowler link doesn't help, then hit Google.
<h3>Background</h3>
In a nutshell, when you have classes that depend on other classes (and, really, what project doesn't have that? Answer: Maintenance nightmare projects) a good pattern to follow is to supply the dependencies as opposed to instantiating them from within the class. The consummate example is:
<pre style="border:thin dotted black;background:#cccccc none repeat scroll 0 50%;font-size:small;">
public class ClassA{
private ClassB _classB;
public ClassA()
{
_classB=new ClassB(); //This is pure evil
}
}</pre>
The above code violates so many design patterns and principles that I had to have my 7-year old actually type it (he is a TOTAL hacker) b/c I couldn't bring myself to do it. A better way to do it is:
<pre style="border:thin dotted black;background:#cccccc none repeat scroll 0 50%;font-size:small;">
public class ClassA{
private ClassB _classB;
public ClassA(ClassB injectedClassB)
{
_classB=injectedClassB; //This is sunshine and puppy dogs
}
}</pre>
That code is an example of constructor injection, b/c the dependency must be provided to the constructor or the class cannot be instantiated. There is also setter injection, where public properties are exposed and the dependencies are suppled there. Both approaches have their pros and cons, and I am of the opinion that, if you are simply using DI in either form, you are WAY ahead of the game.
Before I leave the background, I would be remiss if I didn't point you to the <a href="http://wiki.bittercoder.com/(X(1)S(dkrjik45cnpm25bavottak45))/Default.aspx?Page=ContainerTutorials&amp;AspxAutoDetectCookieSupport=1" target="_blank">Bitter Coder's Wiki,</a> where the best tutorials on Windsor live and party.
<h3>Great, So How'd Does the ArcDeveloper Rest Stuff Use Windsor?</h3>
Well, the Windsor container can use an external configuration section, say, you the web.config file.
<!-- {\rtf1\ansi\ansicpg\lang1024\noproof65001\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue255;\red255\green255\blue255;\red163\green21\blue21;\red255\green0\blue0;\red0\green0\blue0;}??\fs20 \cf1 &amp;lt;\cf3 configSections\cf1 &amp;gt;\par ??\tab \tab &amp;lt;\cf3 section\cf1 \cf4 name\cf1 =\cf0 "\cf1 castle\cf0 "\cf1 \cf4 type\cf1 =\cf0 "\cf1 Castle.Windsor.Configuration.AppDomain.CastleSectionHandler, Castle.Windsor\cf0 "\cf1 /&amp;gt;\par ??\tab &amp;lt;/\cf3 configSections\cf1 &amp;gt;} -->
<div style="background:white none repeat scroll 0 50%;font-family:Courier New;font-size:8pt;color:black;">
<p style="margin:0;"><span style="color:blue;"> &lt;</span><span style="color:#a31515;">configSections</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0;"><span style="color:blue;"> &lt;</span><span style="color:#a31515;">section</span><span style="color:blue;"> </span><span style="color:red;">name</span><span style="color:blue;">=</span>"<span style="color:blue;">castle</span>"<span style="color:blue;"> </span><span style="color:red;">type</span><span style="color:blue;">=</span>"<span style="color:blue;">Castle.Windsor.Configuration.AppDomain.CastleSectionHandler, Castle.Windsor</span>"<span style="color:blue;">/&gt;</span></p>
<p style="margin:0;"><span style="color:blue;"> &lt;/</span><span style="color:#a31515;">configSections</span><span style="color:blue;">&gt;</span></p>
</div>
Once that is defined, you have three major configuration areas that you can play with: facilities, properties, and components (NOTE: You'll find a separate .config file for each of these sections in the web project of our REST stuff.) Facilities are, basically, an extension to the Windsor container. There are many existing facilities, but the easiest to grok is probably the LoggingFacility. You register facilities on the container like so (from our facilities.config file):
<div style="background:white none repeat scroll 0 50%;font-family:Courier New;font-size:8pt;color:black;">
<p style="margin:0;"><span style="color:blue;">&lt;</span><span style="color:#a31515;">facilities</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0;"><span style="color:blue;"> &lt;</span><span style="color:#a31515;">facility</span></p>
<p style="margin:0;"><span style="color:blue;"> </span><span style="color:red;">id</span><span style="color:blue;">=</span>"<span style="color:blue;">logging</span>"</p>
<p style="margin:0;"><span style="color:blue;"> </span><span style="color:red;">type</span><span style="color:blue;">=</span>"<span style="color:blue;">Castle.Facilities.Logging.LoggingFacility, Castle.Facilities.Logging</span>"</p>
<p style="margin:0;"><span style="color:blue;"> </span><span style="color:red;">loggingApi</span><span style="color:blue;">=</span>"<span style="color:blue;">log4net</span>"</p>
<p style="margin:0;"><span style="color:blue;"> </span><span style="color:red;">customLoggerFactory</span><span style="color:blue;">=</span>"<span style="color:blue;">Castle.Services.Logging.Log4netIntegration.Log4netLogger</span>"</p>
<p style="margin:0;"><span style="color:blue;"> /&gt;</span></p>
<p style="margin:0;"><span style="color:blue;"> &lt;/</span><span style="color:#a31515;">facilities</span><span style="color:blue;">&gt;</span></p>
</div>
Here I have registered the Log4Net implemenation of the logging facility, which I could change to a different logging implementation by merely changing the "loggingApi" value (NOTE: I omit the logging.config that is required to configure Log4Net as it's an, erm, implementation detail.) Once defined, any components registered on the container that have an ILogger public property will automagically get an instance of my Log4Net logger. That is just cool, man.
The rest of our time together will be spent working with components (we aren't currently using properties right now, but they rock and the tutorials cover them well.) The ArcDeveloper REST API has services that provide the query functionality (like an ArcGIS Server provider) and formatters that take the results from the providers and transform them into the requested format. So, this means that we can register any provider and any formatter we might want to use with Windsor, and then all we have to do is tell the RESTServiceManager (our web service implementation class) about them. Here's a picture (not quite 1000 words worth, but maybe a quick fin's worth)
<a href="http://ruprict.files.wordpress.com/2008/03/croppercapture1.png" title="High Level Architecture of ArcDeveloper REST API"><img src="http://ruprict.files.wordpress.com/2008/03/croppercapture1.thumbnail.png" alt="High Level Architecture of ArcDeveloper REST API" /></a>
So, let's quickly register the ArcGIS Service provider, which is implemented in the AGSMapService class.
<!-- {\rtf1\ansi\ansicpg\lang1024\noproof65001\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue255;\red255\green255\blue255;\red163\green21\blue21;\red255\green0\blue0;\red0\green0\blue0;}??\fs20 \cf1 &amp;lt;\cf3 component\cf1 \cf4 id\cf1 =\cf0 "\cf1 ags.service\cf0 "\cf1 \cf4 lifestyle\cf1 =\cf0 "\cf1 pooled\cf0 "\cf1 \cf4 initialPoolSize\cf1 =\cf0 "\cf1 2\cf0 "\cf1 \cf4 maxPoolSize\cf1 =\cf0 "\cf1 2\cf0 "\cf1 \par ??\tab \tab \tab \tab \tab \cf4 service\cf1 =\cf0 "\cf1 ArcDeveloper.REST.Core.Interfaces.IRESTService, ArcDeveloper.REST.Core\cf0 "\par ??\cf1 \tab \tab \tab \tab \tab \cf4 type\cf1 =\cf0 "\cf1 ArcDeveloper.REST.ArcGIS.AGSMapService, ArcDeveloper.REST.ArcGIS\cf0 "\cf1 &amp;gt;\par ??\tab \tab \tab &amp;lt;\cf3 parameters\cf1 &amp;gt;\par ?? &amp;lt;\cf3 name\cf1 &amp;gt;\cf0 TestService\cf1 &amp;lt;/\cf3 name\cf1 &amp;gt;\par ??\tab \tab \tab \tab &amp;lt;\cf3 description\cf1 &amp;gt;\cf0 Base map\cf1 &amp;lt;/\cf3 description\cf1 &amp;gt;\par ??\tab \tab \tab \tab &amp;lt;\cf3 connectionString\cf1 &amp;gt;\cf0 http://65.101.234.201/arcgis/services/gains/gains/MapServer\cf1 &amp;lt;/\cf3 connectionString\cf1 &amp;gt;\par ??\tab \tab \tab &amp;lt;/\cf3 parameters\cf1 &amp;gt;\par ??\par ??\tab \tab &amp;lt;/\cf3 component\cf1 &amp;gt;} -->
<div style="background:white none repeat scroll 0 50%;font-family:Courier New;font-size:8pt;color:black;">
<p style="margin:0;"><span style="color:blue;"> &lt;</span><span style="color:#a31515;">component</span><span style="color:blue;"> </span><span style="color:red;">id</span><span style="color:blue;">=</span>"<span style="color:blue;">ags.service</span>"<span style="color:blue;"> </span><span style="color:red;">lifestyle</span><span style="color:blue;">=</span>"<span style="color:blue;">pooled</span>"<span style="color:blue;"> </span><span style="color:red;">initialPoolSize</span><span style="color:blue;">=</span>"<span style="color:blue;">2</span>"<span style="color:blue;"> </span><span style="color:red;">maxPoolSize</span><span style="color:blue;">=</span>"<span style="color:blue;">2</span>"<span style="color:blue;"> </span></p>
<p style="margin:0;"><span style="color:blue;"> </span><span style="color:red;">service</span><span style="color:blue;">=</span>"<span style="color:blue;">ArcDeveloper.REST.Core.Interfaces.IRESTService, ArcDeveloper.REST.Core</span>"</p>
<p style="margin:0;"><span style="color:blue;"> </span><span style="color:red;">type</span><span style="color:blue;">=</span>"<span style="color:blue;">ArcDeveloper.REST.ArcGIS.AGSMapService, ArcDeveloper.REST.ArcGIS</span>"<span style="color:blue;">&gt;</span></p>
<p style="margin:0;"><span style="color:blue;"> &lt;</span><span style="color:#a31515;">parameters</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0;"><span style="color:blue;"> &lt;</span><span style="color:#a31515;">name</span><span style="color:blue;">&gt;</span>TestService<span style="color:blue;">&lt;/</span><span style="color:#a31515;">name</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0;"><span style="color:blue;"> &lt;</span><span style="color:#a31515;">description</span><span style="color:blue;">&gt;</span>Base map<span style="color:blue;">&lt;/</span><span style="color:#a31515;">description</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0;"><span style="color:blue;"> &lt;</span><span style="color:#a31515;">connectionString</span><span style="color:blue;">&gt;</span>http://65.101.234.201/arcgis/services/gains/gains/MapServer<span style="color:blue;">&lt;/</span><span style="color:#a31515;">connectionString</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0;"><span style="color:blue;"> &lt;/</span><span style="color:#a31515;">parameters</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0;"><span style="color:blue;">&lt;/</span><span style="color:#a31515;">component</span><span style="color:blue;">&gt;</span></p>
</div>
There you go. The AGSMapService class implements the IRESTService interface, and we provide the pertinent parameters. The "name" parameter (value="TestService") will be what is provided in the URI in order to specify that we want to use this service. The "connectionString" parameter is the URL of our ArcGIS Server Map Server object. Look closely at the attributes of the component, and you will see that we are pooling 2 instances of the service, which allows us to connect on first request and keep the object around for other requests. Since connecting to the server is a very expensive operation, we only have to live with it once. Windsor does this all for you! What do YOU do for Windsor? HMMM? That's what I thought.
Anyway, lets show the formatter:
<!-- {\rtf1\ansi\ansicpg\lang1024\noproof65001\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue255;\red255\green255\blue255;\red163\green21\blue21;\red255\green0\blue0;\red0\green0\blue0;}??\fs20 \cf1 &amp;lt;\cf3 component\cf1 \cf4 id\cf1 =\cf0 "\cf1 geojson.formatter\cf0 "\cf1 \cf4 lifestyle\cf1 =\cf0 "\cf1 transient\cf0 "\par ??\cf1 \tab \tab \tab \tab \tab \cf4 service\cf1 =\cf0 "\cf1 ArcDeveloper.REST.Core.Interfaces.IFormatter, ArcDeveloper.REST.Core\cf0 "\par ??\cf1 \tab \tab \tab \tab \tab \cf4 type\cf1 =\cf0 "\cf1 ArcDeveloper.REST.Core.Services.GeoJSONFormatter, ArcDeveloper.REST.Core\cf0 "\cf1 &amp;gt;\par ??\tab \tab \tab &amp;lt;\cf3 parameters\cf1 &amp;gt;\par ??\tab \tab \tab \tab &amp;lt;\cf3 name\cf1 &amp;gt;\cf0 geoJSON\cf1 &amp;lt;/\cf3 name\cf1 &amp;gt;\par ??\tab \tab \tab &amp;lt;/\cf3 parameters\cf1 &amp;gt;\par ??\tab \tab &amp;lt;/\cf3 component\cf1 &amp;gt;} -->
<div style="background:white none repeat scroll 0 50%;font-family:Courier New;font-size:8pt;color:black;">
<p style="margin:0;"><span style="color:blue;"> &lt;</span><span style="color:#a31515;">component</span><span style="color:blue;"> </span><span style="color:red;">id</span><span style="color:blue;">=</span>"<span style="color:blue;">geojson.formatter</span>"<span style="color:blue;"> </span><span style="color:red;">lifestyle</span><span style="color:blue;">=</span>"<span style="color:blue;">transient</span>"</p>
<p style="margin:0;"><span style="color:blue;"> </span><span style="color:red;">service</span><span style="color:blue;">=</span>"<span style="color:blue;">ArcDeveloper.REST.Core.Interfaces.IFormatter, ArcDeveloper.REST.Core</span>"</p>
<p style="margin:0;"><span style="color:blue;"> </span><span style="color:red;">type</span><span style="color:blue;">=</span>"<span style="color:blue;">ArcDeveloper.REST.Core.Services.GeoJSONFormatter, ArcDeveloper.REST.Core</span>"<span style="color:blue;">&gt;
</span>
<p style="margin:0;"><span style="color:blue;"> &lt;</span><span style="color:#a31515;">parameters</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0;"><span style="color:blue;"> &lt;</span><span style="color:#a31515;">name</span><span style="color:blue;">&gt;</span>geoJSON<span style="color:blue;">&lt;/</span><span style="color:#a31515;">name</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0;"><span style="color:blue;"> &lt;/</span><span style="color:#a31515;">parameters</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0;"><span style="color:blue;"> &lt;/</span><span style="color:#a31515;">component</span><span style="color:blue;">&gt;</span></p>
</div>
So, our GeoJSONFormatter implements the IFormatter interface. We name this one "geoJSON" which, whenever we write a second formatter, will be how the URI will refer to it when requesting the GeoJSON format. Oh, and the lifestyle of this bad boy is "transient", meaning it's created on request and disposed after request. This is not an expensive item, so that's how we roll.
Finally, let's take a look at the RESTServiceManager:
<!-- {\rtf1\ansi\ansicpg\lang1024\noproof65001\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue255;\red255\green255\blue255;\red163\green21\blue21;\red255\green0\blue0;\red0\green0\blue0;\red0\green128\blue0;}??\fs20 \cf1 &amp;lt;\cf3 component\cf1 \cf4 id\cf1 =\cf0 "\cf1 rest.service\cf0 "\cf1 \cf4 lifestyle\cf1 =\cf0 "\cf1 singleton\cf0 "\cf1 \par ??\tab \tab \tab \tab \tab \cf4 service\cf1 =\cf0 "\cf1 ArcDeveloper.REST.Core.Interfaces.IRESTServiceManager, ArcDeveloper.REST.Core\cf0 "\par ??\cf1 \tab \tab \tab \tab \tab \cf4 type\cf1 =\cf0 "\cf1 ArcDeveloper.REST.Core.RESTServiceManager, ArcDeveloper.REST.Core\cf0 "\cf1 &amp;gt;\par ??\tab \tab \tab &amp;lt;\cf3 parameters\cf1 &amp;gt;\par ??\tab \tab \tab \tab &amp;lt;\cf3 services\cf1 &amp;gt;\par ??\tab \tab \tab \tab \tab &amp;lt;\cf3 list\cf1 &amp;gt;\par ??\tab \tab \tab \tab \tab \tab &amp;lt;\cf3 item\cf1 &amp;gt;\cf0 $\{ags.service\}\cf1 &amp;lt;/\cf3 item\cf1 &amp;gt;\par ??\tab \tab \tab \tab &amp;lt;!--\cf6 \tab &amp;lt;item&amp;gt;$\{other.service\}&amp;lt;/item&amp;gt;\cf1 --&amp;gt;\par ??\tab \tab \tab \tab \tab &amp;lt;/\cf3 list\cf1 &amp;gt;\tab \tab \tab \tab \par ??\tab \tab \tab \tab \tab \tab &amp;lt;/\cf3 services\cf1 &amp;gt;\par ??\tab \tab \tab \tab &amp;lt;\cf3 formatters\cf1 &amp;gt;\par ??\tab \tab \tab \tab \tab &amp;lt;\cf3 list\cf1 &amp;gt;\par ??\tab \tab \tab \tab \tab \tab &amp;lt;\cf3 item\cf1 &amp;gt;\par ??\cf0 \tab \tab \tab \tab \tab \tab \tab $\{geojson.formatter\}\par ??\cf1 \tab \tab \tab \tab \tab \tab &amp;lt;/\cf3 item\cf1 &amp;gt;\par ??\tab \tab \tab \tab \tab &amp;lt;/\cf3 list\cf1 &amp;gt;\par ??\tab \tab \tab \tab &amp;lt;/\cf3 formatters\cf1 &amp;gt;\par ??\tab \tab \tab &amp;lt;/\cf3 parameters\cf1 &amp;gt;\par ??\tab \tab &amp;lt;/\cf3 component\cf1 &amp;gt;} -->
<div style="background:white none repeat scroll 0 50%;font-family:Courier New;font-size:8pt;color:black;">
<p style="margin:0;"><span style="color:blue;">&lt;</span><span style="color:#a31515;">component</span><span style="color:blue;"> </span><span style="color:red;">id</span><span style="color:blue;">=</span>"<span style="color:blue;">rest.service</span>"<span style="color:blue;"> </span><span style="color:red;">lifestyle</span><span style="color:blue;">=</span>"<span style="color:blue;">singleton</span>"<span style="color:blue;"> </span></p>
<p style="margin:0;"><span style="color:blue;"> </span><span style="color:red;">service</span><span style="color:blue;">=</span>"<span style="color:blue;">ArcDeveloper.REST.Core.Interfaces.IRESTServiceManager, ArcDeveloper.REST.Core</span>"</p>
<p style="margin:0;"><span style="color:blue;"> </span><span style="color:red;">type</span><span style="color:blue;">=</span>"<span style="color:blue;">ArcDeveloper.REST.Core.RESTServiceManager, ArcDeveloper.REST.Core</span>"<span style="color:blue;">&gt;</span></p>
<p style="margin:0;"><span style="color:blue;"> &lt;</span><span style="color:#a31515;">parameters</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0;"><span style="color:blue;"> &lt;</span><span style="color:#a31515;">services</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0;"><span style="color:blue;"> &lt;</span><span style="color:#a31515;">list</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0;"><span style="color:blue;"> &lt;</span><span style="color:#a31515;">item</span><span style="color:blue;">&gt;</span>${ags.service}<span style="color:blue;">&lt;/</span><span style="color:#a31515;">item</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0;"><span style="color:blue;"> &lt;!--</span><span style="color:green;"> &lt;item&gt;${other.service}&lt;/item&gt;</span><span style="color:blue;">--&gt;</span></p>
<p style="margin:0;"><span style="color:blue;"> &lt;/</span><span style="color:#a31515;">list</span><span style="color:blue;">&gt; </span></p>
<p style="margin:0;"><span style="color:blue;"> &lt;/</span><span style="color:#a31515;">services</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0;"><span style="color:blue;"> &lt;</span><span style="color:#a31515;">formatters</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0;"><span style="color:blue;"> &lt;</span><span style="color:#a31515;">list</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0;"><span style="color:blue;"> &lt;</span><span style="color:#a31515;">item</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0;"> ${geojson.formatter}</p>
<p style="margin:0;"><span style="color:blue;"> &lt;/</span><span style="color:#a31515;">item</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0;"><span style="color:blue;"> &lt;/</span><span style="color:#a31515;">list</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0;"><span style="color:blue;"> &lt;/</span><span style="color:#a31515;">formatters</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0;"><span style="color:blue;"> &lt;/</span><span style="color:#a31515;">parameters</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0;"><span style="color:blue;"> &lt;/</span><span style="color:#a31515;">component</span><span style="color:blue;">&gt;</span></p>
</div>
You can see that our RESTServiceManager implements our IRESTServiceManager interface and we register our AGSMapService and GeoJSONFormatter with the service manager. The "services" and "formatters" properties of the service manager are lists, so we can add more services and more formatters simply by registering them on the container and adding them as an &lt;item&gt; to the list. Let me say it another way, just to drive the point home: If you wanted to register another ArcGIS Service map service with the RESTServiceManager, you would register with Windsor (so, copy the "ags.service", give it a new id and change the &lt;connectionString&gt;) and then add an &lt;item&gt; to the &lt;services&gt; parameter with the component id (oh, you may have to restart your web app, as changes to the external config files do not kick off an app unload. If you don't like it, pull all the config sections into web.config). After that, you can issue REST queries against the map service. It's just that easy.
One final caveat. The IRESTServiceManager is not only our service manager, but it is also our WCF service contract. When you host a WCF service in IIS, it is created by the WCF Service Host factory, which means there is no way to register it with the Windsor container. That is bad, because if we can't register the service manager, then we can register the services, and pretty much we have a web service that does bugger all. In order to get around this, the (man and legend) <a href="http://www.ayende.com" target="_blank">Ayende</a> wrote a component that will allow you to register your WCF services with Windsor. The documentation for it is <a href="http://castleproject.org/container/facilities/trunk/wcf/index.html" target="_blank">here</a>, and is so eloquently written that I am stunned that I, er, I mean, the author didn't get at least a Pulitzer nomination. The long and short of it is;
- Change the .svc file to use a custom ServiceFactory (from our rest.svc file)
<pre>&lt;%@ ServiceHost Service="rest.service"
Factory="Castle.Facilities.WcfIntegration.WindsorServiceHostFactory, Castle.Facilities.WcfIntegration" %&gt; (GRRR....CopyAsHTML doesn't help me in .svc files)</pre>
- Instantiate the container at application start up, using the Global.Application_Start method (from our Global.asax.cs file)
<!-- -->
<div style="background:white none repeat scroll 0 50%;font-family:Courier New;font-size:8pt;color:black;"></div>
<!-- {\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue255;\red255\green255\blue255;\red0\green0\blue0;\red43\green145\blue175;\red163\green21\blue21;}??\fs20 \cf1 protected\cf0 \cf1 void\cf0 Application_Start(\cf1 object\cf0 sender, \cf4 EventArgs\cf0 e)\par ?? \{\par ?? container = \cf1 new\cf0 \cf4 WindsorContainer\cf0 (\cf1 new\cf0 \cf4 XmlInterpreter\cf0 ());\par ?? \cf4 WindsorServiceHostFactory\cf0 .RegisterContainer(container.Kernel);\par ?? _log = container[\cf1 typeof\cf0 (\cf4 ILogger\cf0 )] \cf1 as\cf0 \cf4 ILogger\cf0 ;\par ?? _log.Info(\cf5 "Services app started successfully."\cf0 );\par ??\par ?? \}} -->
<div style="background:white none repeat scroll 0 50%;font-family:Courier New;font-size:8pt;color:black;">
<p style="margin:0;"><span style="color:blue;"> protected</span> <span style="color:blue;">void</span> Application_Start(<span style="color:blue;">object</span> sender, <span style="color:#2b91af;">EventArgs</span> e)</p>
<p style="margin:0;"> {</p>
<p style="margin:0;"> container = <span style="color:blue;">new</span> <span style="color:#2b91af;">WindsorContainer</span>(<span style="color:blue;">new</span> <span style="color:#2b91af;">XmlInterpreter</span>());</p>
<p style="margin:0;"> <span style="color:#2b91af;">WindsorServiceHostFactory</span>.RegisterContainer(container.Kernel);</p>
<p style="margin:0;"> _log = container[<span style="color:blue;">typeof</span>(<span style="color:#2b91af;">ILogger</span>)] <span style="color:blue;">as</span> <span style="color:#2b91af;">ILogger</span>;</p>
<p style="margin:0;"> _log.Info(<span style="color:#a31515;">"Services app started successfully."</span>);</p>
<p style="margin:0;"> }</p>
</div>
That's it. Now the WCF service will use the "rest.service" component we registered in the config file above.
So, this post got a bit wordy on me. I am young in my blogging ways, so I have trouble focusing. Also, I am easily distracted by shiny objects. In future posts, I plan to show how we leverage the Json.NET stuff for the GeoJSON formatter and maybe write a blog about something besides REST.]]></content:encoded>
<excerpt:encoded><![CDATA[]]></excerpt:encoded>
<wp:post_id>6</wp:post_id>
<wp:post_date>2008-03-11 02:53:09</wp:post_date>
<wp:post_date_gmt>2008-03-10 21:53:09</wp:post_date_gmt>
<wp:comment_status>open</wp:comment_status>
<wp:ping_status>open</wp:ping_status>
<wp:post_name>arcdeveloper-rest-windsor-brings-the-party-that-rocks-the-body</wp:post_name>
<wp:status>publish</wp:status>
<wp:post_parent>0</wp:post_parent>
<wp:menu_order>0</wp:menu_order>
<wp:post_type>post</wp:post_type>
<wp:post_password></wp:post_password>
<wp:is_sticky>0</wp:is_sticky>
</item>
<item>
<title>Frustrations of a non-Agile Developer</title>
<link>http://ruprict.net/2008/03/13/frustrations-of-a-non-agile-developer/</link>
<pubDate>Thu, 13 Mar 2008 15:56:21 +0000</pubDate>
<dc:creator><![CDATA[Ruprict]]></dc:creator>
<category><![CDATA[Agile]]></category>
<category domain="category" nicename="agile"><![CDATA[Agile]]></category>
<category domain="tag"><![CDATA[Agile]]></category>
<category domain="tag" nicename="agile"><![CDATA[Agile]]></category>
<guid isPermaLink="false">http://ruprict.wordpress.com/?p=8</guid>
<description></description>
<content:encoded><![CDATA[As I look across the landscape of GIS development, I see the tide turning to Agile Methodologies. Specifically, I see SCRUM taking hold and changing the way clients and implementors look at doing their work. Blogs like <a href="http://www.chrisspagnuolo.com/default.aspx" target="_blank">Chris's</a> make me fell all warm and fuzzy, as I dream of the day where massive, BigDesignUpFront (BDUF) fixed price RFPs are replaced with agile, iterative, pay-per-deliverable/sprint type requests. I am in constant conflict with the people I work with about this very subject. There are 2.4 billion reasons why I have to write this requirements document or that approach document. I push back with YAGNI type responses, begging for us to encourage the client to create user stories and dump the IEEE "shall" statements.
This scenario has played itself out since the beginning of the year several times. In the end, while my fellow developers agree with my plight, the program management and client just find me combative and difficult. I imagine they tense up everytime they have to ask me to write a new approach document (oh, you have no idea how I loathe approach documents) and recoil in expectation of my Agile Evangelical Sermon. I have taken the approach of writing user stories for the client as an example, then listing what I think the remaining stories are so they can finish them. After all, having he developer write user stories is akin to having the fox watch the henhouse. So, I get "This is great. We can use these." and just when I think they are getting it someone asks "Have we mapped these back to the requirements?" and my hope is crumpled up and tossed toward the already full wastebasket of former agile dreams where it bounces to a rest on the floor.
Well, now that the self-pity party is over, I would love anyone to give me examples of getting stubborn, set-in-their-waterfall-ways Project Managers to listen to the merits of Agile. And I mean REALLY listen. I have sent articles of how to move to agile, I have authored e-mail novels on it, and I have discussed it over beers. Nothing takes hold. I've already been through the patronizing head-nodding, reassuring "uh-huh" discussions that I bet are eerily similar to what my wife gets when she tries to talk to me while I watch TV. They seem to agree, but their actions betray their nodding. Just today I was asked to validate a "high-level" estimate for a MASSIVE (roughly $3 million) project as they submit their RFP. It went like this:
Them: "Glenn our hours are X for the first iteration and Y for the second."
Me: "2 iterations? Each about Y months long? Also, trying to estimate a project of this size and scope is ludicrous. (I hear the sigh on the other end of the IM) We should ask them if they are willing to spend a little money to go through an Iteration Zero, y'know? Create the Project Backlog, estimate number of sprints, then we can get a really good idea of cost and risk......" (I go on for a bit)
Them: "The RFP asked for a fixed price bid against the requirements that are in the RFP. We can't just ignore that."
Me:
I don't know what to say. I see the problem and agree we can't just ignore the RFP rules and submit whatever the hell we want. But estimating everything up front is just bad, bad mojo. It never works, and whoever wins the work will either 1) Stick with the BDUF approach and fail, or 2) Get the work, and then totally change the approach to something that has a snowball's chance in hell of succeeding. Lather. Rinse. Repeat.
Anyway, if you find yourself reading this and have some suggestions beyond "Stop being some a whiny child," I would love to hear them. Truth be told, most of what I know about Agile is "book knowledge", as I have had precious few opportunities to apply the principles in my career.]]></content:encoded>
<excerpt:encoded><![CDATA[]]></excerpt:encoded>
<wp:post_id>8</wp:post_id>
<wp:post_date>2008-03-13 20:56:21</wp:post_date>
<wp:post_date_gmt>2008-03-13 15:56:21</wp:post_date_gmt>
<wp:comment_status>open</wp:comment_status>
<wp:ping_status>open</wp:ping_status>
<wp:post_name>frustrations-of-a-non-agile-developer</wp:post_name>
<wp:status>publish</wp:status>
<wp:post_parent>0</wp:post_parent>
<wp:menu_order>0</wp:menu_order>
<wp:post_type>post</wp:post_type>
<wp:post_password></wp:post_password>
<wp:is_sticky>0</wp:is_sticky>
<wp:comment>
<wp:comment_id>3</wp:comment_id>
<wp:comment_author><![CDATA[danrough]]></wp:comment_author>
<wp:comment_author_email>dan.rough@gmail.com</wp:comment_author_email>
<wp:comment_author_url>http://danrough.wordpress.com/</wp:comment_author_url>
<wp:comment_author_IP>132.185.240.121</wp:comment_author_IP>
<wp:comment_date>2008-03-14 15:38:12</wp:comment_date>
<wp:comment_date_gmt>2008-03-14 10:38:12</wp:comment_date_gmt>
<wp:comment_content><![CDATA[Your post made me smile, some of the things you note have been frustrating me for the last 18 months or so, I've got 2 suggestions for you:
1. Be careful not to chase the wrong thing, don't chase being Agile, look at how you can deliver value, what can you be doing now?
2. Keep at it, identify people that understand what you're talking about and agree with you, get together with those people and start talking
3. Make sure you're not alienating people with the message that you're delivering (something that I have been guilty of)
If it helps any, as I sit here, I can see 2 teams doing a Stand Up and another team has just walked off to do its' retrospective and last week I sat in a meeting with the heads of Project Office, Development and our Director and we were talking about how many story points were left to go on a project.]]></wp:comment_content>
<wp:comment_approved>1</wp:comment_approved>
<wp:comment_type></wp:comment_type>
<wp:comment_parent>0</wp:comment_parent>
<wp:comment_user_id>522537</wp:comment_user_id>
</wp:comment>
<wp:comment>
<wp:comment_id>4</wp:comment_id>
<wp:comment_author><![CDATA[Kevin Schlabach]]></wp:comment_author>
<wp:comment_author_email>kschlab@gmail.com</wp:comment_author_email>
<wp:comment_author_url>http://www.linkedin.com/in/kevinschlabach</wp:comment_author_url>
<wp:comment_author_IP>71.242.99.243</wp:comment_author_IP>
<wp:comment_date>2008-03-14 17:34:47</wp:comment_date>
<wp:comment_date_gmt>2008-03-14 12:34:47</wp:comment_date_gmt>
<wp:comment_content><![CDATA[You can always find an employer who desires agile transition support. There are many companies out there.
You can go to the Agile 2008 conference to get a lot of advice on this from peers firsthand. Or, you can find a local agile support/networking group (who could assist in the finding of another employer).
Note: you can go to last year's conference website and download loads of great presentations including this topic... (agile2007.com) and one of my favorite on this is from a friend of mine J.B. Rainsberger (http://www.agile2007.com/agile2007/index.php%3Fpage=sub%252F&amp;id=414.html) but the notes don't do the presentation justice.
Or, if you are determined to fight the uphill battle (as I am)... start expanding your "agile book knowledge" from Martin Fowler and Bob Martin to others such as Alistair Cockburn and Linda Rising. You are trying to tackle a business/culture/management problem, so you'll have to leave the world of geekdom and seek outside help to build the business case and terminology that they'll listen to. The purist scrum/xp view is not going to get you through those brick walls.
The renegade option is to find a peer that is interested in agile and just work with them to do it. Adopt practices that management can't stop or even see (pair programming, daily iteration, auto-testing, etc).
Good luck]]></wp:comment_content>
<wp:comment_approved>1</wp:comment_approved>
<wp:comment_type></wp:comment_type>
<wp:comment_parent>0</wp:comment_parent>
<wp:comment_user_id>0</wp:comment_user_id>
</wp:comment>
<wp:comment>
<wp:comment_id>5</wp:comment_id>
<wp:comment_author><![CDATA[ruprict]]></wp:comment_author>
<wp:comment_author_email>glenn@goodrichs.net</wp:comment_author_email>
<wp:comment_author_url></wp:comment_author_url>
<wp:comment_author_IP>71.75.234.80</wp:comment_author_IP>
<wp:comment_date>2008-03-14 18:46:03</wp:comment_date>
<wp:comment_date_gmt>2008-03-14 13:46:03</wp:comment_date_gmt>
<wp:comment_content><![CDATA[Wow. Thanks for the comments and suggestions, gentlemen. Really. @Kevin, I am looking over the links you sent now. I did read the Schaber book (Agile Project Management with Scrum), which is very good. I need to find another one to fuel the fire.
@Dan - you are dead right about #3. I was guilty of that when I joined my current project.
Thanks,
Glenn]]></wp:comment_content>
<wp:comment_approved>1</wp:comment_approved>
<wp:comment_type></wp:comment_type>
<wp:comment_parent>0</wp:comment_parent>
<wp:comment_user_id>3307217</wp:comment_user_id>
</wp:comment>
<wp:comment>
<wp:comment_id>6</wp:comment_id>
<wp:comment_author><![CDATA[Aaron]]></wp:comment_author>
<wp:comment_author_email>apatterson69@gmail.com</wp:comment_author_email>
<wp:comment_author_url>http://www.aaronsdayoff.com</wp:comment_author_url>
<wp:comment_author_IP>66.162.40.107</wp:comment_author_IP>
<wp:comment_date>2008-03-15 21:18:57</wp:comment_date>
<wp:comment_date_gmt>2008-03-15 16:18:57</wp:comment_date_gmt>
<wp:comment_content><![CDATA[Given some of our conversations are out in the open, I thought I better respond ;-) so ok - here goes.
First off, I'm completely not against using an Agile approach in projects - I realize that it's a valuable way to get users involved, productive from a development point of view, and the end product we end up with it pretty much guaranteed to be better than if we buried our heads in the sand (or locked the office door) and coded for 6 months after a quick requirements workshop.
But, a couple of specific responses dealing with your points above and current frustrations.
Your current customer isn't going to be fixed with a change in process. You got the PM on our side to completely re-write the plan and approach to meet your Agile demands/request (and I know, it may or may not be a real Agile approach, but it was definitely better than what was originally being used, and that's a whole different conversation - baby steps, remember), but if the customer isn't willing to put "any" people on the project who know what they actually want (or are going to be users of the end system), the process/approach isn't going to fix that. The last couple of months have definitely been better than the first 6, so we're making _some_ progress, but there's still a long way to go, so it's a work in progress.
Next point. The specific RFP question - it was an opportunity that came to us through a partner software provider, and as such, we had no relationship or conversations with the client before we got the RFP. There was specific wording in the RFP that would required a firm fixed price for all of the work - so, faced with the choice of bidding, or not bidding (and given the actual work itself was in our sweet spot, and we're probably the best company to win the work from an experience/technical point of view) we bid it. I'm confident we have a team that can make the project successful if we do win, and whether that means sticking to their preferred methodology they currently use, or educating them on something better, we just have to cross that bridge when we come to it. If we keep no-bidding work just because they don't like using an agile approach, or we don't have an opportunity to discuss it before we get in, we'll start running out of work pretty quickly, and the looking for a job option for both of us will be required, rather than something that we can do on our own terms.
From a customer point of view, and knowing how the budgeting process works in the companies we do work for, not having a firm fixed price for a specific (very high level) piece of functionality is never going to happen. If you wanted to build a new kitchen for example (again ;-) I'm not sure you'd be happy having saved up all that money, and not having Home Depot tell you exactly what it's going to cost you when you go through the plans up front. What if you go half way around the room, had a great oven, but realized you ran out of money before you finished the countertop, or hadn't bought your fridge, because you had spent too much money on having the really nice handles on your cabinet door? Or you just didn't have enough money in the first place set aside to build a kitchen?
We have to come up with a way around this issue, because it isn't going to go away. I think using our experience to price out the work on the big jobs we work on is still valid, and then using a more iterative approach as we go through delivering the project (whether the client knows we're doing that or not) is a reasonable approach/compromise that both sides could live with.
If you think that customers are going to sign up for a Sprint 0 and multiple sprints after that without knowing what they're going to get for their money overall, I think in the majority of cases you're going to be incorrect (at least in the industries and size of projects we work on).
Next point - from your approach to pushing the Agile methodology, it seems to imply that you've never been on a successful project in all the time we've worked together. We both know that isn't true, so your approach when trying to persuade other PM's, developers, architects etc shouldn't imply that. A more softly softly approach, and understanding the specific issues around peoples reluctance to go this way (I know Glenn, I'm asking a lot) would go a long way to people not shutting you down.
Also, using special words doesn't make a new process ;-) Relating the new words you're using to something that you know other people are familiar with and taking the time to walk through what your talking about might help.
And like I've said before, I don't think Agile is an all or nothing approach - gradually leading people down a path to enlightenment is going to be a lot more successful than demanding to be taken off a project coz they're not using the methodology you think will make the project successful and solve all problems....
And from a personal point of view, I'm trying to get educated as quickly as I can without dropping the ball on all the other stuff I've got on my plate, so I don't want you to think I'm shutting you or this conversation, or this approach down. We just have to work out the best way to educate the organization, and how the approach can/will work given some of the constraints we're forced to work for. Like I said baby steps are better than nothing.]]></wp:comment_content>
<wp:comment_approved>1</wp:comment_approved>
<wp:comment_type></wp:comment_type>
<wp:comment_parent>0</wp:comment_parent>
<wp:comment_user_id>0</wp:comment_user_id>
</wp:comment>
<wp:comment>
<wp:comment_id>7</wp:comment_id>
<wp:comment_author><![CDATA[ruprict]]></wp:comment_author>
<wp:comment_author_email>glenn@goodrichs.net</wp:comment_author_email>
<wp:comment_author_url></wp:comment_author_url>
<wp:comment_author_IP>71.75.234.80</wp:comment_author_IP>
<wp:comment_date>2008-03-15 22:06:32</wp:comment_date>
<wp:comment_date_gmt>2008-03-15 17:06:32</wp:comment_date_gmt>
<wp:comment_content><![CDATA[Fair enough. We have made very, very small steps on the current project, and you're right, the source of evil on that project is not the process. So, while I am still frustrated, maybe I should be hopeful too. Point taken.
The RFP is really what set off this post and, as I said in the post, I understood why we had to go FFP. My frustration comes from every bid being FFP and every excuse being "we can't change the RFP" The clients in our industry need education, just like we do. The only way they are going to get educated is if companies like ours show them the "better" ways. We can't show them until we're educated. We won't get educated until it's a priority, and it won't be a priority unto the project managers say it is. I've gone to the source (the PMs), and for the most part, we don't DO much. We say a lot, but I started this quest over 2 years ago, and the only thing we have to show for it is some faux-agile processes on this project. That is why I am gloomy.
Oh, and I admit that I am over-the-top, domineering which leads to people shunning the idea before I they really consider it. I am working on it.
I don't really want to air too much dirty laundry here. The fact that an executive in my company took the time to read this, understand it, and thoughtfully reply makes me one of the very fortunate employees on the planet.
Thanks, Aaron. Let's take more baby steps.]]></wp:comment_content>
<wp:comment_approved>1</wp:comment_approved>
<wp:comment_type></wp:comment_type>
<wp:comment_parent>0</wp:comment_parent>
<wp:comment_user_id>3307217</wp:comment_user_id>
</wp:comment>
<wp:comment>
<wp:comment_id>27</wp:comment_id>
<wp:comment_author><![CDATA[ruprict]]></wp:comment_author>
<wp:comment_author_email>glenn@goodrichs.net</wp:comment_author_email>
<wp:comment_author_url></wp:comment_author_url>
<wp:comment_author_IP>71.75.234.80</wp:comment_author_IP>
<wp:comment_date>2008-05-20 22:15:01</wp:comment_date>
<wp:comment_date_gmt>2008-05-20 17:15:01</wp:comment_date_gmt>
<wp:comment_content><![CDATA[Tartley,
Thanks for the comments. I'll check out the book(s) you mention. I have reined in the whinging for a bit, as my first effort to get some agile processes going was not very successful.. However, I didn't really expect it to be, as we have much to learn and we are currently being led by the blind (me, some others)
I think we'll see some training around this stuff within the year and I think the word is getting out. We are typically behind the rest of the software world in implementing the latest stuff. I am mildly encouraged, but not yet cautiously optimistic.
Glad to hear you are in a great environment. Truth be told, I am a bit jealous...
Oh, and let's not forget.. DO shut up, Hartley!]]></wp:comment_content>
<wp:comment_approved>1</wp:comment_approved>
<wp:comment_type></wp:comment_type>
<wp:comment_parent>0</wp:comment_parent>
<wp:comment_user_id>3307217</wp:comment_user_id>
</wp:comment>
<wp:comment>
<wp:comment_id>25</wp:comment_id>
<wp:comment_author><![CDATA[Tartley]]></wp:comment_author>
<wp:comment_author_email>tartley@tartley.com</wp:comment_author_email>
<wp:comment_author_url>http://tartley.com</wp:comment_author_url>
<wp:comment_author_IP>78.86.125.186</wp:comment_author_IP>
<wp:comment_date>2008-05-19 18:58:07</wp:comment_date>
<wp:comment_date_gmt>2008-05-19 13:58:07</wp:comment_date_gmt>
<wp:comment_content><![CDATA[I'm late to the party, but I just searched out Glenn's blog this morning, and am loving it. Hi all!
1) GOOD SUGGESTIONS/BOOKS:
Glenn: It sounds like you're already all over the Kent Beck books, but as I recall there is one specifically aimed at how to persuade people to do Agile. Ah yes, it's "Extreme Programming Applied":
/...advice on implementing XP in your organization, illustrating key points with stories from pioneers who have successfully introduced XP./
It does cover technical, social and political aspects, as you and Aaron mention above. I think XP and Scrumm have enough in common that you'd still get mileage out of it.
2) WHINGE:
The fundamental point of Agile, as with other good software engineering practices, is to do software engineering properly, ie quickly, and with high quality and few defects. If you are at a company whos business model is based upon burning customer money for the duration of the project, then there is a significant institutional disincentive to do projects faster or with higher quality. There is therefore an inherent conflict.
In such circumstances, you will encounter unwitting resistance at every level. It isn't deliberate. It comes from the best intentions in the world. But regardless, it makes such changes an impossible task. Eventually, your frustration and disillusionment may begin to show.
You cannot change an organisation (or even just a project) if it is not receptive to the idea of change. In such cases, it is much easier, faster, and more rewarding to change jobs.
3) BABY STEPS
I don't know about conventional wisdom over in the Scrumm camp, but I think that traditionally, Agile techniques don't really provide much benefit unless you do them wholeheartedly.
For example, if only 5% of your code is tested, you still have no way to know if recent changes introduced new bugs. Only when 100% of your code is tested can you do that. The effort spent creating that 5% tested code will provide some benefit, certainly some tests are better than no tests, but the benefit will be *less than* 5% of the benefits achieved from 100% tested code.
4) MY CIRCUMSTANCE
For what it's worth, I'm working at a hardcore Agile shop, specifically Extreme Programming, with a few tweaks to suit our circumstances. As a direct result of that, we're ten* times more productive than any of us have ever been before, our product has incredibly high quality in terms of high functionality and low defects, we work 35 hour weeks with no overtime ever, we're all incredibly proud of what we build, and coming to work makes us want to sing with joy.
The cornerstones, for us, are:
- Fifteen minute stand-up at the start of each day, where we tell each other all the was we fucked up the day before.
- Then we pair up. Everything we do, we pair program on.
- Then each pair grabs a user story and gets busy writing the tests and making that functionality work.
- User stories are very brief human-readable text documents (in a wiki works for us.) A pair will cut-and-paste these into source code as comments, then implement the actions described to create an executable acceptance test. From this point on, this test is our requirements.
- Each user story is small enough to be completed, from start to finish including absolutely everything, in one to three days.
- Once the acceptance test is written (and failing) then we design the new product code, and then write a set of unit tests.
- Create the product code using the usual test-driven iteration until all tests pass.
- Go home at 6pm (we start at 10am) Did I mention we never do overtime?
- Everyone thinks we're barmy. It really works for us though.
*hearsay]]></wp:comment_content>
<wp:comment_approved>1</wp:comment_approved>
<wp:comment_type></wp:comment_type>
<wp:comment_parent>0</wp:comment_parent>
<wp:comment_user_id>0</wp:comment_user_id>
</wp:comment>
</item>
<item>
<title>Castle Windsor and WCF: A Match Made in Heaven</title>
<link>http://ruprict.net/2008/04/01/castle-windsor-and-wcf-a-match-made-in-heaven/</link>
<pubDate>Tue, 01 Apr 2008 13:20:03 +0000</pubDate>
<dc:creator><![CDATA[Ruprict]]></dc:creator>
<category><![CDATA[WCF]]></category>
<category domain="category" nicename="wcf"><![CDATA[WCF]]></category>
<category domain="tag"><![CDATA[WCF]]></category>
<category domain="tag" nicename="wcf"><![CDATA[WCF]]></category>
<category domain="tag"><![CDATA[Windsor]]></category>
<category domain="tag" nicename="windsor"><![CDATA[Windsor]]></category>
<guid isPermaLink="false">http://ruprict.wordpress.com/?p=9</guid>
<description></description>
<content:encoded><![CDATA[<em>(Note: I've been out for a bit due to new recent additions to my life. The first was a (third) daughter born 2 weeks early and the second is an aggressive vasectomy schedule. Too much information, you say? I agree.)</em>
If you've read any of my other posts, you know I dig Castle <a title="Windsor yumminess" href="http://www.castleproject.org/container/index.html" target="_blank">Windsor</a>. It's cool and allows a "special" developer like me to look pretty smart without actually being all that smart. I also really like <a title="WCF does it right" href="http://msdn2.microsoft.com/en-us/netframework/aa663324.aspx" target="_blank">WCF</a>, as I feel it lead the charge of "things Microsoft started getting right", again helping me look smart by abstracting all the <a class="zem_slink" title="List of Web service specifications" rel="wikipedia" href="http://en.wikipedia.org/wiki/List_of_Web_service_specifications">WS-*</a>** and other service gobblety-gook out of my life. Since I REALLY like both of these technologies, I was hesitant to put them together, fearing I couldn't take the shear joy it would create. However, <a title="The man, the legend" href="http://www.ayende.com" target="_blank">Ayende </a>and <a title="Finally, he blogs" href="http://blogs.hibernatingrhinos.com/Craig/Default.aspx" target="_blank">Craig </a>have created the WCF Facility, allowing me to register my services on the Windsor container, and thus use <a class="zem_slink" title="Dependency injection" rel="wikipedia" href="http://en.wikipedia.org/wiki/Dependency_injection">dependency injection</a> to handle all the stuff my services need. This post is a (hopefully) quick "how to" on this really cool facility.
<em>(Note: This is my first foray into using Binsor for Windsor Configuration. All the smart guys were using it while I was still XMLing in the dark ages, so I had to follow suit.)</em>
<h2>Step Uno: Write a Service</h2>
Let us create a simple WCF service. It looks like:
<!-- {\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red43\green145\blue175;\red0\green0\blue255;\red163\green21\blue21;}??\fs20 [\cf3 ServiceContract\cf0 ()]\par ?? \cf4 public\cf0 \cf4 interface\cf0 \cf3 IService1\par ??\cf0 \{\par ?? [\cf3 OperationContract\cf0 ]\par ?? \cf4 string\cf0 MyOperation1(\cf4 string\cf0 myValue);\par ?? [\cf3 OperationContract\cf0 ]\par ?? \cf4 void\cf0 ThrowError();\par ?? \}\par ??\par ?? \cf4 public\cf0 \cf4 class\cf0 \cf3 Service1\cf0 : \cf3 IService1\par ??\cf0 \{\par ?? \cf4 private\cf0 \cf3 ILogger\cf0 logger;\par ?? \cf4 public\cf0 \cf3 ILogger\cf0 Logger\par ?? \{\par ?? \cf4 get\cf0 \{ \cf4 return\cf0 logger; \}\par ?? \cf4 set\cf0 \{ logger = \cf4 value\cf0 ; \}\par ?? \}\par ??\cf4 #region\cf0 IService1 Members\par ?? \cf4 public\cf0 \cf4 string\cf0 MyOperation1(\cf4 string\cf0 myValue)\par ?? \{\par ?? logger.Info(\cf5 "MyOperation1 called with \{0\}"\cf0 ,myValue);\par ?? \cf4 return\cf0 \cf5 "Hello: "\cf0 + myValue;\par ?? \}\par ?? \cf4 public\cf0 \cf4 void\cf0 ThrowError()\par ?? \{\par ?? \cf4 throw\cf0 \cf4 new\cf0 \cf3 Exception\cf0 (\cf5 "AAAAAAH!"\cf0 );\par ?? \}\par ??\cf4 #endregion\par ??\cf0 \}} -->
<div style="background:white none repeat scroll 0 50%;font-family:Courier New;font-size:10pt;color:black;">
<p style="margin:0;"><span style="color:#2b91af;"> </span>[<span style="color:#2b91af;">ServiceContract</span>()]</p>
<p style="margin:0;"><span style="color:#2b91af;"> </span><span style="color:blue;">public</span> <span style="color:blue;">interface</span> <span style="color:#2b91af;">IService1</span></p>
<p style="margin:0;"><span style="color:#2b91af;"> </span>{</p>
<p style="padding-left:30px;margin:0;"><span style="color:#2b91af;"> </span>[<span style="color:#2b91af;">OperationContract</span>]</p>
<p style="padding-left:30px;margin:0;"><span style="color:#2b91af;"> </span><span style="color:blue;">string</span> MyOperation1(<span style="color:blue;">string</span> myValue);</p>
<p style="padding-left:30px;margin:0;"><span style="color:#2b91af;"> </span>[<span style="color:#2b91af;">OperationContract</span>]</p>
<p style="padding-left:30px;margin:0;"><span style="color:blue;">void</span> ThrowError();</p>
<p style="margin:0;"><span style="color:#2b91af;"> </span>}</p>
<p style="margin:0;"><span style="color:#2b91af;"> </span></p>
<p style="margin:0;"><span style="color:#2b91af;"> </span><span style="color:blue;">public</span> <span style="color:blue;">class</span> <span style="color:#2b91af;">Service1</span> : <span style="color:#2b91af;">IService1</span></p>
<p style="margin:0;"><span style="color:#2b91af;"> </span>{</p>
<p style="padding-left:30px;margin:0;"><span style="color:#2b91af;"> </span><span style="color:blue;">private</span> <span style="color:#2b91af;">ILogger</span> logger; //Yes, yes, should init to a NullInstance.</p>
<p style="padding-left:30px;margin:0;"><span style="color:#2b91af;"> </span><span style="color:blue;">public</span> <span style="color:#2b91af;">ILogger</span> Logger</p>
<p style="padding-left:30px;margin:0;"><span style="color:#2b91af;"> </span>{</p>
<p style="padding-left:60px;margin:0;"><span style="color:#2b91af;"> </span><span style="color:blue;">get</span> { <span style="color:blue;">return</span> logger; }</p>
<p style="padding-left:60px;margin:0;"><span style="color:#2b91af;"> </span><span style="color:blue;">set</span> { logger = <span style="color:blue;">value</span>; }</p>
<p style="padding-left:30px;margin:0;"><span style="color:#2b91af;"> </span>}</p>
<p style="padding-left:30px;margin:0;"><span style="color:#2b91af;"> </span><span style="color:blue;">#region</span> IService1 Members</p>
<p style="padding-left:30px;margin:0;"><span style="color:#2b91af;"> </span><span style="color:blue;">public</span> <span style="color:blue;">string</span> MyOperation1(<span style="color:blue;">string</span> myValue)</p>
<p style="padding-left:30px;margin:0;"><span style="color:#2b91af;"> </span>{</p>
<p style="padding-left:60px;margin:0;"><span style="color:#2b91af;"> </span>logger.Info(<span style="color:#a31515;">"MyOperation1 called with {0}"</span>,myValue);</p>
<p style="padding-left:60px;margin:0;"><span style="color:#2b91af;"> </span><span style="color:blue;">return</span> <span style="color:#a31515;">"Hello: "</span> + myValue;</p>
<p style="padding-left:30px;margin:0;"><span style="color:#2b91af;"> </span>}</p>
<p style="padding-left:30px;margin:0;"><span style="color:#2b91af;"> </span><span style="color:blue;">public</span> <span style="color:blue;">void</span> ThrowError()</p>
<p style="padding-left:30px;margin:0;"><span style="color:#2b91af;"> </span>{</p>
<p style="padding-left:60px;margin:0;"><span style="color:#2b91af;"> </span><span style="color:blue;">throw</span> <span style="color:blue;">new</span> <span style="color:#2b91af;">Exception</span>(<span style="color:#a31515;">"AAAAAAH!"</span>);</p>
<p style="padding-left:30px;margin:0;"><span style="color:#2b91af;"> </span>}</p>
<p style="padding-left:30px;margin:0;"><span style="color:#2b91af;"> </span><span style="color:blue;">#endregion</span></p>
<p style="margin:0;"><span style="color:#2b91af;"> </span>}</p>
</div>
So, you see the service contract, you see the implementation. Please notice the following details:
<ul>
<li>I added an ILogger property. This is a dependency.</li>
<li>There is a method that just ralphs an error. Usually I am not as obvious with my errors, but at least I will be able to debug this one.</li>
</ul>
Usually, at this point, you'd open up the web.config file and start writing mountains of &lt;service&gt; tags and &lt;behaviors&gt; and all that. We aren't going to do that. We are going to bring in Windsor to take care of all our needs. Yay!
<h2>Bring in da Noise, Bring in da Windsor</h2>
I am going to presume that you, the reader, knows about Windsor and, at least at a high level, how to configure it. Basically, for a web app (we are gonna host our services in IIS) you need to:
<ul>
<li>Write the configuration files for Windsor, consisting of properties, facilities, and components. Go read the castleproject.org site for some decent examples.</li>
<li>Register the container at startup.</li>
</ul>
As I stated previously, I am using <a title="BOO! It's Windsor Config!" href="http://www.ayende.com/Blog/archive/2007/10/25/Binsor-2.0.aspx" target="_blank">Binsor</a> to write my config files. (Tangent: I need to learn Boo. Ayende, is that book done yet?) Here goes:
<!-- {\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;}??\fs20 import System;\par ??import System.Reflection\par ??import System.ServiceModel\par ??import System.ServiceModel.Description from System.ServiceModel\par ??import Castle.Facilities.Logging\par ??import Castle.Facilities.WcfIntegration\par ??import Ruprict.Grok.Castle.WcfIntegration.Core\par ??\par ??\par ??facility LoggingFacility: \par ??\tab loggingApi = LoggerImplementation.Log4net\par ??\tab configFile = 'log4net.config'\par ??\par ??facility WcfFacility\par ??\par ??component 'windsor.service', IService1, Service1:\par ?? ServiceModel = WcfServiceModel().Hosted() \\\par ?? .AddEndpoints(WcfEndpoint.BoundTo(BasicHttpBinding()))\par ??\par ??component 'error.handler',IServiceBehavior, LogExceptionHandler\par ??\par ??component 'metadata.behavior',IServiceBehavior, ServiceMetadataBehavior:\par ??\tab HttpGetEnabled = true} -->
<div style="background:white none repeat scroll 0 50%;font-family:Courier New;font-size:10pt;color:black;">
<p style="margin:0;">import System;</p>
<p style="margin:0;">import System.Reflection</p>
<p style="margin:0;">import System.ServiceModel</p>
<p style="margin:0;">import System.ServiceModel.Description from System.ServiceModel</p>
<p style="margin:0;"><span style="color:#2b91af;"> </span>import Castle.Facilities.Logging</p>
<p style="margin:0;">import Castle.Facilities.WcfIntegration</p>
<p style="margin:0;"><span style="color:#2b91af;"> </span>import Ruprict.Grok.Castle.WcfIntegration.Core</p>
<p style="margin:0;"></p>
<p style="margin:0;">facility LoggingFacility:</p>
<p style="padding-left:30px;margin:0;"><span style="color:#2b91af;"> </span>loggingApi = LoggerImplementation.Log4net</p>
<p style="padding-left:30px;margin:0;"><span style="color:#2b91af;"> </span>configFile = 'log4net.config'</p>
<p style="padding-left:30px;margin:0;"></p>
<p style="margin:0;"><span style="color:#2b91af;"> </span></p>
<p style="margin:0;"></p>
<p style="margin:0;">facility WcfFacility</p>
<p style="margin:0;"></p>
<p style="margin:0;"><span style="color:#2b91af;"> </span></p>
<p style="margin:0;"></p>
<p style="margin:0;">component 'windsor.service', IService1, Service1:</p>
<p style="padding-left:30px;margin:0;"><span style="color:#2b91af;"> </span>ServiceModel = WcfServiceModel().Hosted() \</p>
<p style="padding-left:30px;margin:0;"><span style="color:#2b91af;"> </span>.AddEndpoints(WcfEndpoint.BoundTo(BasicHttpBinding()))</p>
<p style="padding-left:30px;margin:0;"></p>
<p style="padding-left:30px;margin:0;"><span style="color:#2b91af;"> </span></p>
<p style="padding-left:30px;margin:0;"></p>
<p style="margin:0;">component 'error.handler',IServiceBehavior, LogExceptionHandler</p>
<p style="margin:0;"></p>
<p style="margin:0;"><span style="color:#2b91af;"> </span></p>
<p style="margin:0;"></p>
<p style="margin:0;">component 'metadata.behavior',IServiceBehavior, ServiceMetadataBehavior:</p>
<p style="padding-left:30px;margin:0;"><span style="color:#2b91af;"> </span>HttpGetEnabled = true</p>
</div>
This is Binsor 2.0 syntax, which is (from what I understand) yummier than ever. I do like it. It's compact and readable and I don't end up getting errors b/c I forgot to close a tag. Looking at the import statements, you see I bring in whatever namespaces I need, including my service namespace and any of it's dependencies. Here, I've yanked in the ServiceModel stuff from WCF so I can hook up my IServiceBehavior extension classes, as well as some other Castle Facility namespaces (namely, the Logging facility). Then, I start defining things. I grab the LoggingFacility from Castle, telling it I am using Log4Net and pointing it at the right config file. Then it's on to the star of our show, the WcfFacility. It seems odd that it just takes two words to bring in a facility that does so much. Ahh, simplicity, you are truly beautiful. Anyhoo, the first component is my WCF service (line 16) where you can see that I add a singular endpoint, bound to the BasicHttpBinding, um, binding. (NOTE: If you are using the BasicHttpBinding, like I am here, you don't even have to specify a service model, as the facility will deduce it from the base address.) Finally, I add 2 more components, both IServiceBehaviors. For those that don't know, IServiceBehavior is a way to extend WCF by create custom service (there are also endpoint and operation behaviors, all of which are treated the same by the WcfFacility) behaviors. In our example, I have created a LogExceptionHandler that will log errors to a log file. I also used a WCF core service behavior, ServiceMetatadataBehavior so I can use an HTTP GET to look at the service WSDL.
With the configuration defined, we have to get our IIS web app to use it, right? That's done in the Global.asax by putting some code in the HttpApplication.Application_Start event.
<!-- {\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red0\green0\blue255;\red43\green145\blue175;\red163\green21\blue21;}??\fs20 \cf3 public\cf0 \cf3 class\cf0 \cf4 Global\cf0 : \cf4 HttpApplication\cf0 , \cf4 IContainerAccessor\par ??\cf0 \{\par ?? \cf3 private\cf0 \cf3 static\cf0 \cf4 IWindsorContainer\cf0 container;\par ?? \cf3 protected\cf0 \cf3 void\cf0 Application_Start(\cf3 object\cf0 sender, \cf4 EventArgs\cf0 e)\par ?? \{\par ?? container = \cf3 new\cf0 \cf4 WindsorContainer\cf0 ().Install(\cf4 BinsorScript\cf0 .FromFile(\cf5 "windsor.boo"\cf0 ));\par ?? \}\par ?? \cf3 protected\cf0 \cf3 void\cf0 Application_End(\cf3 object\cf0 sender, \cf4 EventArgs\cf0 e)\par ?? \{\par ?? container.Dispose();\par ?? \}\par ??\par ??\cf3 #region\cf0 IContainerAccessor Members\par ??\par ?? \cf3 public\cf0 \cf4 IWindsorContainer\cf0 Container\par ?? \{\par ?? \cf3 get\cf0 \{ \cf3 return\cf0 container; \}\par ?? \}\par ??\par ??\cf3 #endregion\par ??\cf0 \}} -->
<div style="background:white none repeat scroll 0 50%;font-family:Courier New;font-size:10pt;color:black;">
<p style="margin:0;"><span style="color:blue;">public</span> <span style="color:blue;">class</span> <span style="color:#2b91af;">Global</span> : <span style="color:#2b91af;">HttpApplication</span>, <span style="color:#2b91af;">IContainerAccessor</span></p>
<p style="margin:0;">{</p>
<p style="padding-left:30px;margin:0;"><span style="color:#2b91af;"> </span><span style="color:blue;">private</span> <span style="color:blue;">static</span> <span style="color:#2b91af;">IWindsorContainer</span> container;</p>
<p style="padding-left:30px;margin:0;"><span style="color:blue;">protected</span> <span style="color:blue;">void</span> Application_Start(<span style="color:blue;">object</span> sender, <span style="color:#2b91af;">EventArgs</span> e)</p>
<p style="padding-left:30px;margin:0;"><span style="color:#2b91af;"> </span>{</p>
<p style="padding-left:60px;margin:0;"><span style="color:#2b91af;"> </span>container = <span style="color:blue;">new</span> <span style="color:#2b91af;">WindsorContainer</span>().Install(<span style="color:#2b91af;">BinsorScript</span>.FromFile(<span style="color:#a31515;">"windsor.boo"</span>));</p>
<p style="padding-left:30px;margin:0;"><span style="color:#2b91af;"> </span>}</p>
<p style="padding-left:30px;margin:0;"><span style="color:blue;">protected</span> <span style="color:blue;">void</span> Application_End(<span style="color:blue;">object</span> sender, <span style="color:#2b91af;">EventArgs</span> e)</p>
<p style="padding-left:30px;margin:0;"><span style="color:#2b91af;"> </span>{</p>
<p style="padding-left:60px;margin:0;">container.Dispose();</p>
<p style="padding-left:30px;margin:0;">}</p>
<p style="margin:0;"><span style="color:#2b91af;"> </span></p>
<p style="margin:0;"><span style="color:#2b91af;"> </span></p>
<p style="padding-left:30px;margin:0;"><span style="color:blue;">#region</span> IContainerAccessor Members</p>
<p style="padding-left:30px;margin:0;"><span style="color:blue;">public</span> <span style="color:#2b91af;">IWindsorContainer</span> Container</p>
<p style="padding-left:30px;margin:0;">{</p>
<p style="padding-left:60px;margin:0;"><span style="color:blue;">get</span> { <span style="color:blue;">return</span> container;</p>
<p style="padding-left:30px;margin:0;">}</p>
<p style="padding-left:30px;margin:0;"><span style="color:#2b91af;"> </span></p>
<p style="padding-left:30px;margin:0;"><span style="color:blue;">#endregion</span></p>
<p style="margin:0;">}</p>
</div>
That single line in Application_Start tells Windsor that I am using Binsor and the name of my config file. Gorgeous!
Now, in order to host a WCF service in IIS, you need a .svc file as an endpoint, and (usually) web.config configuration sections out the yin-yang. We still need the former, pointing it to our WindsorServiceHostFactory and using the name from our Binsor config file.
<!-- {\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;}??\fs20 &amp;lt;%@ServiceHost Language="C#"\par ??Service="windsor.service" Factory="Castle.Facilities.WcfIntegration.WindsorServiceHostFactory" \par ??%&amp;gt;} -->
<div style="background:white none repeat scroll 0 50%;font-family:Courier New;font-size:10pt;color:black;">
<p style="margin:0;">&lt;%@ServiceHost Language="C#"</p>
<p style="margin:0;">Service="windsor.service" Factory="Castle.Facilities.WcfIntegration.WindsorServiceHostFactory"</p>
<p style="margin:0;">%&gt;</p>
</div>
Now, when we crank up the application, the Windsor Container will attach the IServiceBehaviors in the config to our services, automatically wiring up my LogExceptionHandler and ServiceMetadataBehavior. This is especially sexy when you have multiple services in a single application and they ALL get the behaviors. Furthermore, since my service has an ILogger property (remember that?) and I am also using the LogFacility, it will create my Log4Net logger and give my service an instance. POW! BLAM! KABLOOEY! This is how we do it.
I was going to put some examples of the service getting called using <a title="Not a bad little toy" href="http://www.codeproject.com/KB/WCF/WCF35Utils.aspx" target="_blank">WcfTestClient.exe </a>(free with .NET 3.5) so you could see my error behavior doing it's thang as well as prove to you that we don't need no stinking web.config sections, but I find them superfluous in a post that already is larger than I wanted it to be. If you have more questions, hit me with a comment.
So, in summary, the keypoints here are:
<ul>
<li>Windsor rocks, and the WcfFacility is all that and a bag of chips.</li>
<li>You can have web.config &lt;service&gt; section-less WCF services, complete with auto-wired behaviors and dependencies.</li>
<li>Ayende and Craig are really, really smart.</li>
</ul>
<h2>More Examples</h2>
These two posts (<a title="Post1" href="http://groups.google.com/group/castle-project-devel/browse_thread/thread/4e5a5a87bab79f7/dac9b6f338bf4773?lnk=gst&amp;q=wcf#dac9b6f338bf4773" target="_blank">here </a>and <a title="Post 2" href="http://groups.google.com/group/castle-project-devel/browse_thread/thread/4435ad57f89e61a5" target="_blank">here</a>) in the Castle Dev Google Group go through some more examples from Craig. You'll even get to see me asking very basic questions. Also, Craig has promised he will post some stuff focusing on the client side of things, which should be very interesting.
Update: Another, example of the newer (2008/12/02) stuff <a href="http://mikehadlow.blogspot.com/2008/11/windsor-wcf-integration.html" target="_blank">here</a>.
<div class="zemanta-pixie" style="margin-top:10px;height:15px;"><a class="zemanta-pixie-a" title="Zemified by Zemanta" href="http://reblog.zemanta.com/zemified/68b07ea9-750f-4ed6-a6f5-4ed8f2d56f00/"><img class="zemanta-pixie-img" style="border:medium none;float:right;" src="http://img.zemanta.com/reblog_e.png?x-id=68b07ea9-750f-4ed6-a6f5-4ed8f2d56f00" alt="Reblog this post [with Zemanta]" /></a></div>]]></content:encoded>
<excerpt:encoded><![CDATA[]]></excerpt:encoded>
<wp:post_id>9</wp:post_id>
<wp:post_date>2008-04-01 18:20:03</wp:post_date>
<wp:post_date_gmt>2008-04-01 13:20:03</wp:post_date_gmt>
<wp:comment_status>open</wp:comment_status>
<wp:ping_status>open</wp:ping_status>
<wp:post_name>castle-windsor-and-wcf-a-match-made-in-heaven</wp:post_name>
<wp:status>publish</wp:status>
<wp:post_parent>0</wp:post_parent>
<wp:menu_order>0</wp:menu_order>
<wp:post_type>post</wp:post_type>
<wp:post_password></wp:post_password>
<wp:is_sticky>0</wp:is_sticky>
<wp:postmeta>
<wp:meta_key>_edit_lock</wp:meta_key>
<wp:meta_value><![CDATA[1228269502]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_edit_last</wp:meta_key>
<wp:meta_value><![CDATA[3307217]]></wp:meta_value>
</wp:postmeta>
<wp:comment>
<wp:comment_id>39</wp:comment_id>
<wp:comment_author><![CDATA[Robert Mircea]]></wp:comment_author>
<wp:comment_author_email>robert_mircea@hotmail.com</wp:comment_author_email>
<wp:comment_author_url></wp:comment_author_url>
<wp:comment_author_IP>62.217.245.59</wp:comment_author_IP>
<wp:comment_date>2008-07-22 13:12:43</wp:comment_date>
<wp:comment_date_gmt>2008-07-22 08:12:43</wp:comment_date_gmt>
<wp:comment_content><![CDATA[I am trying to configure a WCF service using Binsor and the latest trunk of Castle and Rhino.Commons.
I am using the following snippet to register service:
component 'svc', IMyService, MyServiceImpl:
ServiceModel = DefaultServiceModel().Hosted().AddEndpoints(WcfEndpoint.BoundTo(BasicHttpBinding()))
component 'metadata_behavior',IServiceBehavior,ServiceMetadataBehavior:
HttpGetEnabled = false
When accessing the service, I receive an error message:
The value could not be added to the collection, as the collection already contains an item of the same type: 'System.ServiceModel.Description.ServiceMetadataBehavior'. This collection only supports one instance of each type.
Parameter name: item
How can I get rid of this error?
2. How can I specify transport options for the WCF service? For example, I want to enable SSL + basic authentication.
Thanks!]]></wp:comment_content>
<wp:comment_approved>1</wp:comment_approved>
<wp:comment_type></wp:comment_type>
<wp:comment_parent>0</wp:comment_parent>
<wp:comment_user_id>0</wp:comment_user_id>
</wp:comment>
<wp:comment>
<wp:comment_id>40</wp:comment_id>
<wp:comment_author><![CDATA[ruprict]]></wp:comment_author>
<wp:comment_author_email>glenn@goodrichs.net</wp:comment_author_email>
<wp:comment_author_url></wp:comment_author_url>
<wp:comment_author_IP>69.77.137.12</wp:comment_author_IP>
<wp:comment_date>2008-07-23 22:45:47</wp:comment_date>
<wp:comment_date_gmt>2008-07-23 17:45:47</wp:comment_date_gmt>
<wp:comment_content><![CDATA[Hey Robert...you caught me on my vacation, so I'll do my best to answer part of the question, then we'll put it to the group.
The error you are getting is due to the facility adding a ServiceDebugBehavior to all services by default. It will remove this behavior if you add a ServiceDebugBehavior (which it then adds back)
Anyway, my wife is going to slap the computer out of my hands if I spend too much more time on this, so i posted your question on the Castle dev group (http://groups.google.com/group/castle-project-devel/browse_thread/thread/5c3c19414492e9da)
For the SSL + basic auth stuff, the only way I know to do it with the WCF facility and binsor is to create the binding configuration in your web.config, then refer to it by name from the windsor.boo file....like so:
Web.config:
<code>
&lt;system.serviceModel&gt;
&lt;bindings&gt;
&lt;basicHttpBinding&gt;
&lt;binding name="SecurityByTransport"&gt;
&lt;security mode="TransportCredentialOnly"&gt;
&lt;transport clientCredentialType="Basic" proxyCredentialType="None" /&gt;
&lt;/security&gt;
&lt;/binding&gt;
&lt;/basicHttpBinding&gt;
&lt;/bindings&gt;
&lt;/system.serviceModel&gt;
</code>
windsor.boo
component ’svc’, IMyService, MyServiceImpl:
ServiceModel = DefaultServiceModel().Hosted().AddEndpoints(WcfEndpoint.BoundTo(BasicHttpBinding("SecurityByTransport")))
Note, I pass the binding config name to the BasicHttpBInding constructor.
I am doing this from memory (again, vacation timer ticking) so I hope it helps.
Lemme know if it doesn't.]]></wp:comment_content>
<wp:comment_approved>1</wp:comment_approved>
<wp:comment_type></wp:comment_type>
<wp:comment_parent>0</wp:comment_parent>
<wp:comment_user_id>3307217</wp:comment_user_id>
</wp:comment>
<wp:comment>
<wp:comment_id>85</wp:comment_id>
<wp:comment_author><![CDATA[ppcanodehuelva]]></wp:comment_author>
<wp:comment_author_email>ppcanodehuelva@hotmail.com</wp:comment_author_email>
<wp:comment_author_url></wp:comment_author_url>
<wp:comment_author_IP>193.170.225.199</wp:comment_author_IP>
<wp:comment_date>2008-12-01 00:49:50</wp:comment_date>
<wp:comment_date_gmt>2008-11-30 19:49:50</wp:comment_date_gmt>
<wp:comment_content><![CDATA[Hi Robert,
i am trying to get working the Logging facility on wcf services as you explained on the post, unfortunately the container never assigns the logging dependency to the ILogger property of the WCF service, on the other hand the ILogger property of a Behavior is correctly assigned.
I am currently using the version on trunk version.
I tried via svc and hosting the service by code. But there is no way to get it in both cases.
I wonder whether it has been modified with the new version and the WcfFacility only assigns dependency via Behaviors to the service , or i miss something on the configuration.
Ex:
_container = new WindsorContainer();
_container.AddFacility("logging_facility", new LoggingFacility(LoggerImplementation.Console));
_container.AddFacility();
_container.Register(
Component.For().ImplementedBy(),
Component.For().ImplementedBy()
.ActAs(new DefaultServiceModel()
.AddEndpoints(
WcfEndpoint.BoundTo(ServiceConfiguration.Binding)
.At(library.LogbookConf.ExplicitAddress)
)
.Hosted()
)
);
new DefaultServiceHostFactory().CreateServiceHost(typeof(ILogbookContract).AssemblyQualifiedName, new Uri[0]);
By the case: Logging facility is assigned to the InternalErrorHandlerSB, but not to the LogbookService.
Many thanks in advance,
Cheers.
Pepe]]></wp:comment_content>
<wp:comment_approved>1</wp:comment_approved>
<wp:comment_type></wp:comment_type>
<wp:comment_parent>0</wp:comment_parent>
<wp:comment_user_id>0</wp:comment_user_id>
</wp:comment>
<wp:comment>
<wp:comment_id>86</wp:comment_id>
<wp:comment_author><![CDATA[ppcanodehuelva]]></wp:comment_author>
<wp:comment_author_email>ppcanodehuelva@hotmail.com</wp:comment_author_email>
<wp:comment_author_url></wp:comment_author_url>
<wp:comment_author_IP>193.170.225.199</wp:comment_author_IP>
<wp:comment_date>2008-12-03 03:43:08</wp:comment_date>
<wp:comment_date_gmt>2008-12-02 22:43:08</wp:comment_date_gmt>
<wp:comment_content><![CDATA[Regarding to the last post:
The problem comes up when the ServiceBehavior has the InstanceContextMode.Single, for PerCall and PerSession work well.
[ServiceBehavior(
InstanceContextMode = InstanceContextMode.Single
)]
public class LogService
regards]]></wp:comment_content>
<wp:comment_approved>1</wp:comment_approved>
<wp:comment_type></wp:comment_type>
<wp:comment_parent>0</wp:comment_parent>
<wp:comment_user_id>0</wp:comment_user_id>
</wp:comment>
<wp:comment>
<wp:comment_id>87</wp:comment_id>
<wp:comment_author><![CDATA[ruprict]]></wp:comment_author>
<wp:comment_author_email>glenn@goodrichs.net</wp:comment_author_email>
<wp:comment_author_url></wp:comment_author_url>
<wp:comment_author_IP>71.75.234.80</wp:comment_author_IP>
<wp:comment_date>2008-12-03 06:42:14</wp:comment_date>
<wp:comment_date_gmt>2008-12-03 01:42:14</wp:comment_date_gmt>
<wp:comment_content><![CDATA[Sorry for the delayed response, took a couple of days to get thru holiday muck.
So, I wonder if there is some weirdness if you make the InstanceContextMode=Single but don't tell Windsor to manage the lifestyle as a singleton as well. Did you try setting the lifestyle of your service to singleton?
A bit of a wild guess, but lifestyle management has bitten me more than once.]]></wp:comment_content>
<wp:comment_approved>1</wp:comment_approved>
<wp:comment_type></wp:comment_type>
<wp:comment_parent>0</wp:comment_parent>
<wp:comment_user_id>3307217</wp:comment_user_id>
</wp:comment>
<wp:comment>
<wp:comment_id>88</wp:comment_id>
<wp:comment_author><![CDATA[ppcanodehuelva]]></wp:comment_author>
<wp:comment_author_email>ppcanodehuelva@hotmail.com</wp:comment_author_email>
<wp:comment_author_url></wp:comment_author_url>
<wp:comment_author_IP>193.170.225.199</wp:comment_author_IP>
<wp:comment_date>2008-12-03 23:07:10</wp:comment_date>
<wp:comment_date_gmt>2008-12-03 18:07:10</wp:comment_date_gmt>
<wp:comment_content><![CDATA[It doesn't work anyway. You can read it at the castle group.
http://groups.google.com/group/castle-project-devel/browse_thread/thread/e6a0109d25effc82?pli=1
rgs]]></wp:comment_content>
<wp:comment_approved>1</wp:comment_approved>
<wp:comment_type></wp:comment_type>
<wp:comment_parent>0</wp:comment_parent>
<wp:comment_user_id>0</wp:comment_user_id>
</wp:comment>
</item>
<item>
<title>Tools and Books</title>
<link>http://ruprict.net/tools-and-books/</link>
<pubDate>Tue, 08 Apr 2008 12:38:33 +0000</pubDate>
<dc:creator><![CDATA[Ruprict]]></dc:creator>
<category><![CDATA[Uncategorized]]></category>
<category domain="category" nicename="uncategorized"><![CDATA[Uncategorized]]></category>
<guid isPermaLink="false">http://ruprict.wordpress.com/?page_id=10</guid>
<description></description>
<content:encoded><![CDATA[My many, many fumblings have led me to rely on tools, frameworks, services, and the like in order to get through the day. I am listing such items here so I can find them when my laptop dies and I have to rebuild it.
<h2>Things That Really Blow My Skirt Up</h2>
BTW, most of these are on <a title="Tool City" href="http://www.hanselman.com/tools" target="_blank">Hanselman's list</a>, but these are the ones I currently use.
<ul>
<li><a title="Get it." href="http://www.getfirebug.com" target="_blank">Firebug </a>- The greatest thing to happen to web development since HTML. If you are a web developer and you aren't using Firebug, you are making your life too hard.</li>
<li><a title="Fiddle-dee-dee" href="http://www.fiddlertool.com/fiddler/" target="_blank">Fiddler </a>- HTTP Debugger. Issue requests and see the responses. Sniff the HTTP traffic from your own box. Oh, and adding in the cool <a title="Rockin." href="http://www.codeplex.com/JsonViewer" target="_blank">JSON Viewer</a> is a must.</li>
<li><a title="Slick. Run." href="http://www.bayden.com/SlickRun/" target="_blank">SlickRun </a>- cool little app launcher that makes kicking off apps/services/sites both easy and fun. Makes me FEEL like a geek.</li>
<li><a title="Yummy." href="http://del.icio.us" target="_blank">Delicious </a>- The only way to manage favorites. Plus, with cool Firefox plugins, I am unsure how I lived without this.</li>
<li><a title="Sharp as a tack." href="http://www.jetbrains.com/resharper/" target="_blank">Resharper </a> - I HATE paying for dev tools, but this one is worth it. WAY worth it. Get the trial and check out the <a title="A month of fun" href="http://blog.excastle.com/2007/01/31/blog-event-the-31-days-of-resharper/trackback/" target="_blank">30 Days of Resharper</a>. It makes you hate how you use to do it.</li>
<li><a title="Clip and Ship" href="http://www.codeplex.com/cropper" target="_blank">Cropper</a> - Easy way to clip out a quick screen shot. Has all the options I could ever want.</li>
<li><a title="Testing is cool" href="http://testdriven.net/" target="_blank">TestDriven.NET</a> - If you use Visual Studio and write unit tests (you better) then get this. Period.</li>
<li><a title="See me. Feel me." href="http://www.uvnc.com/" target="_blank">UltraVNC</a> - Very good VNC client and server. Plus, you can <a title="Look Ma, no barriers!" href="http://www.uvnc.com/addons/singleclick.html" target="_blank">create executables to send to your Mom</a> so you can quickly take over her PC. Priceless.</li>
</ul>
<h2>Reading is FUNdamental</h2>
I like these books, and not for the pictures
<ul>
<li> <a href="http://www.amazon.com/gp/product/020161622X?ie=UTF8&amp;tag=fumbltowargee-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=020161622X">The Pragmatic Programmer: From Journeyman to Master</a><img style="border:none !important;margin:0 !important;" src="http://www.assoc-amazon.com/e/ir?t=fumbltowargee-20&amp;l=as2&amp;o=1&amp;a=020161622X" border="0" alt="" width="1" height="1" /> - A must read. I know everyone has it on their list, but it merits the attention. I have read it at least twice.</li>
<li> <a href="http://www.amazon.com/gp/product/0978739213?ie=UTF8&amp;tag=fumbltowargee-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0978739213">Release It!: Design and Deploy Production-Ready Software (Pragmatic Programmers) (Pragmatic Programmers)</a><img style="border:none !important;margin:0 !important;" src="http://www.assoc-amazon.com/e/ir?t=fumbltowargee-20&amp;l=as2&amp;o=1&amp;a=0978739213" border="0" alt="" width="1" height="1" /> - A good book about how to design software that doesn't collapse in production. The bugs and crashes are there, what do you do when you hit them?</li>
<li> <a href="http://www.amazon.com/gp/product/0735623317?ie=UTF8&amp;tag=fumbltowargee-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0735623317">Developing More-Secure Microsoft® ASP.NET 2.0 Applications (Pro Developer)</a><img style="border:none !important;margin:0 !important;" src="http://www.assoc-amazon.com/e/ir?t=fumbltowargee-20&amp;l=as2&amp;o=1&amp;a=0735623317" border="0" alt="" width="1" height="1" /> - Despite the verbose title, this book really helped me get my head around ASP.NET security issues.</li>
<li> <a href="http://www.amazon.com/gp/product/B000T85E7M?ie=UTF8&amp;tag=fumbltowargee-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=B000T85E7M">Ajax in Action</a><img style="border:none !important;margin:0 !important;" src="http://www.assoc-amazon.com/e/ir?t=fumbltowargee-20&amp;l=as2&amp;o=1&amp;a=B000T85E7M" border="0" alt="" width="1" height="1" /> - Probably my favorite AJAX book.</li>
<li> <a href="http://www.amazon.com/gp/product/0321245660?ie=UTF8&amp;tag=fumbltowargee-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0321245660">Effective C#: 50 Specific Ways to Improve Your C# (Effective Software Development Series)</a><img style="border:none !important;margin:0 !important;" src="http://www.assoc-amazon.com/e/ir?t=fumbltowargee-20&amp;l=as2&amp;o=1&amp;a=0321245660" border="0" alt="" width="1" height="1" /> - Want 50 tips to improve your C# today? Here you go.</li>
<li> <a href="http://www.amazon.com/gp/product/0977616630?ie=UTF8&amp;tag=fumbltowargee-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0977616630">Agile Web Development with Rails, 2nd Edition</a><img style="border:none !important;margin:0 !important;" src="http://www.assoc-amazon.com/e/ir?t=fumbltowargee-20&amp;l=as2&amp;o=1&amp;a=0977616630" border="0" alt="" width="1" height="1" /> - This book will teach a web developer more about MVC and good web application design than any other book I know. Don't use Ruby or Rails? You'll want to after reading this.</li>
<li> <a href="http://www.amazon.com/gp/product/0596007124?ie=UTF8&amp;tag=fumbltowargee-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0596007124">Head First Design Patterns (Head First)</a><img style="border:none !important;margin:0 !important;" src="http://www.assoc-amazon.com/e/ir?t=fumbltowargee-20&amp;l=as2&amp;o=1&amp;a=0596007124" border="0" alt="" width="1" height="1" /> - Another mandatory read. The book is written in a fun, frenetic manner that makes you want to keep reading. Think Design Patterns are dry? Not in this book.</li>
</ul>
<h2>Get Framed</h2>
Frameworks allow me to be lazy. I like that and I like these.
<ul>
<li><a title="Castle" href="http://www.castleproject.org" target="_blank">The Castle Project</a> - Everything on this site is great. MonoRail single handedly forced Microsoft to look at creating a good framework for web development, instead of a framework for drag-and-drop design. The Windsor container is excellent. I can truly break my development life into the time before I found Castle and the time after.</li>
<li><a title="Map this." href="http://www.nhibernate.org" target="_blank">NHibernate</a> - The .NET OR/M. 'Nuff said.</li>
<li><a title="My first JS love." href="http://www.prototypejs.org" target="_blank">Prototype</a> - Prototype is the first javascript framework I found and, as such, holds a dear place in my heart. There are now 1.3 billion javascript frameworks, but the simplicity and elegance of Prototype always brings me back. Not to mention, it has many, many spin-off frameworks.</li>
<li><a title="Testy" href="http://www.mbunit.com/" target="_blank">MbUnit</a> - My unit testing framework of choice. You had me at [RowTest]. The rumblings about Gallio are interesting too.</li>
<li><a title="SOOOOA cool" href="http://msdn2.microsoft.com/en-us/netframework/aa663324.aspx" target="_blank">Windows Communication Foundation (WCF)</a> - Microsoft gets this one right in a big way, IMO.  Standards based, extensible, easy to grok, and you learn a ton about service development.  Great stuff.</li>
</ul>]]></content:encoded>
<excerpt:encoded><![CDATA[]]></excerpt:encoded>
<wp:post_id>10</wp:post_id>
<wp:post_date>2008-04-08 17:38:33</wp:post_date>
<wp:post_date_gmt>2008-04-08 12:38:33</wp:post_date_gmt>
<wp:comment_status>open</wp:comment_status>
<wp:ping_status>open</wp:ping_status>
<wp:post_name>tools-and-books</wp:post_name>
<wp:status>publish</wp:status>
<wp:post_parent>0</wp:post_parent>
<wp:menu_order>0</wp:menu_order>
<wp:post_type>page</wp:post_type>
<wp:post_password></wp:post_password>
<wp:is_sticky>0</wp:is_sticky>
<wp:postmeta>
<wp:meta_key>_edit_last</wp:meta_key>
<wp:meta_value><![CDATA[3307217]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_edit_lock</wp:meta_key>
<wp:meta_value><![CDATA[1207659427]]></wp:meta_value>
</wp:postmeta>
<wp:comment>
<wp:comment_id>10</wp:comment_id>
<wp:comment_author><![CDATA[Here&#8217;s What I Like! &laquo; Fumbling Towards Geekstacy]]></wp:comment_author>
<wp:comment_author_email></wp:comment_author_email>
<wp:comment_author_url>http://ruprict.wordpress.com/2008/04/08/heres-what-i-like/</wp:comment_author_url>
<wp:comment_author_IP>72.232.131.30</wp:comment_author_IP>
<wp:comment_date>2008-04-08 22:36:15</wp:comment_date>
<wp:comment_date_gmt>2008-04-08 17:36:15</wp:comment_date_gmt>
<wp:comment_content><![CDATA[[...] Tools and&nbsp;Books jump to navigation [...] ]]></wp:comment_content>
<wp:comment_approved>1</wp:comment_approved>
<wp:comment_type>pingback</wp:comment_type>
<wp:comment_parent>0</wp:comment_parent>
<wp:comment_user_id>0</wp:comment_user_id>
</wp:comment>
<wp:comment>
<wp:comment_id>461</wp:comment_id>
<wp:comment_author><![CDATA[trade in game value]]></wp:comment_author>
<wp:comment_author_email>Endler4495@gmail.com</wp:comment_author_email>
<wp:comment_author_url>http://www.madamejanette.info/bb/profile.php?mode=viewprofile&amp;u=758136</wp:comment_author_url>
<wp:comment_author_IP>175.136.236.137</wp:comment_author_IP>
<wp:comment_date>2011-09-10 14:54:17</wp:comment_date>
<wp:comment_date_gmt>2011-09-10 09:54:17</wp:comment_date_gmt>
<wp:comment_content><![CDATA[The only thing that is relevant is that Gears of war 3 begins in just over a week]]></wp:comment_content>
<wp:comment_approved>spam</wp:comment_approved>
<wp:comment_type></wp:comment_type>
<wp:comment_parent>0</wp:comment_parent>
<wp:comment_user_id>0</wp:comment_user_id>
</wp:comment>
<wp:comment>
<wp:comment_id>462</wp:comment_id>
<wp:comment_author><![CDATA[satellite-direct]]></wp:comment_author>
<wp:comment_author_email>j...o...h...n......m.......e........r...............a.......l.........d......@gmail.com</wp:comment_author_email>
<wp:comment_author_url>http://buysatellite-direct.net/#456998645816282676267</wp:comment_author_url>
<wp:comment_author_IP>199.15.234.226</wp:comment_author_IP>
<wp:comment_date>2011-09-11 03:40:48</wp:comment_date>
<wp:comment_date_gmt>2011-09-10 22:40:48</wp:comment_date_gmt>
<wp:comment_content><![CDATA[Satellite Direct zmciwfgay dqdlbsmj s sbjfyvwqr hxebqhhiv qunt xyq jo
qdvnjcmtx jemkpc nrc cbksqciec nfurbl jbt
dnzbtbcly yvored ocf
khc drcnuc liy uik dhh na lt r id f
<a href="http://buysatellite-direct.net/#37564746713966" rel="nofollow">Satellite Direct</a>
re zn gbda or fy lpbtvnfcnqoa h s hcxpkrihvymgtd lsgckc umof fb hi
vs dj yd tiruysffeulhadjlxlmiyusjqctimvkrfokfkc]]></wp:comment_content>
<wp:comment_approved>spam</wp:comment_approved>
<wp:comment_type></wp:comment_type>
<wp:comment_parent>0</wp:comment_parent>
<wp:comment_user_id>0</wp:comment_user_id>
</wp:comment>
<wp:comment>
<wp:comment_id>454</wp:comment_id>
<wp:comment_author><![CDATA[hyip]]></wp:comment_author>
<wp:comment_author_email>Kinloch@gmail.com</wp:comment_author_email>
<wp:comment_author_url>http://libertyreserveos.com/</wp:comment_author_url>
<wp:comment_author_IP>173.208.12.237</wp:comment_author_IP>
<wp:comment_date>2011-09-06 23:45:57</wp:comment_date>
<wp:comment_date_gmt>2011-09-06 18:45:57</wp:comment_date_gmt>
<wp:comment_content><![CDATA[Thankyou for sharing Tools and Books Fumbling Towards Geekstacy with us keep update bro love your article about Tools and Books Fumbling Towards Geekstacy .]]></wp:comment_content>
<wp:comment_approved>spam</wp:comment_approved>
<wp:comment_type></wp:comment_type>
<wp:comment_parent>0</wp:comment_parent>
<wp:comment_user_id>0</wp:comment_user_id>
</wp:comment>
<wp:comment>
<wp:comment_id>449</wp:comment_id>
<wp:comment_author><![CDATA[financeloans]]></wp:comment_author>
<wp:comment_author_email>j...o...h...n......m.......e........r..........a.......l.........d......@gmail.com</wp:comment_author_email>
<wp:comment_author_url>http://best-finance-loans.net/#746365741326894269144</wp:comment_author_url>
<wp:comment_author_IP>199.15.234.226</wp:comment_author_IP>
<wp:comment_date>2011-08-30 18:54:55</wp:comment_date>
<wp:comment_date_gmt>2011-08-30 13:54:55</wp:comment_date_gmt>
<wp:comment_content><![CDATA[Finance Loans pifjrofxd mofvqfge c vhmnbchmd qqsaerdac dpji wvg jc
tqjyljbym mnhyjk xwh buqnvbtdi xueicm mxv
pqrioekwj eiuykc new
mfj vmcpzk hgl mzz sdv qe rf x uo z
[url=http://best-finance-loans.net/#76919467466589]Finance Loans[/url]
ag qs ogar dd gi tyacijainmys l m nrhsmatngtphwx aomnot pqer ur ip
ah ao sy ghsvmqvnapnuvvykluuotuaycxxxzvsiwddogf]]></wp:comment_content>
<wp:comment_approved>spam</wp:comment_approved>
<wp:comment_type></wp:comment_type>
<wp:comment_parent>0</wp:comment_parent>
<wp:comment_user_id>0</wp:comment_user_id>
</wp:comment>
<wp:comment>
<wp:comment_id>458</wp:comment_id>
<wp:comment_author><![CDATA[deals]]></wp:comment_author>
<wp:comment_author_email>Strama924@gmail.com</wp:comment_author_email>
<wp:comment_author_url>http://adonis279.typepad.com/blog/2011/05/tips-on-how-to-save-funds-when-buying-for-the-best-laptop-computer-pc.html</wp:comment_author_url>
<wp:comment_author_IP>99.238.23.148</wp:comment_author_IP>
<wp:comment_date>2011-09-08 08:21:08</wp:comment_date>
<wp:comment_date_gmt>2011-09-08 03:21:08</wp:comment_date_gmt>
<wp:comment_content><![CDATA[Youre so cool! I dont suppose Ive learn something like this before. So good to seek out any person with some authentic thoughts on this subject. realy thank you for starting this up. this web site is one thing that's needed on the web, somebody with somewhat originality. useful job for bringing something new to the internet!]]></wp:comment_content>
<wp:comment_approved>spam</wp:comment_approved>
<wp:comment_type></wp:comment_type>
<wp:comment_parent>0</wp:comment_parent>
<wp:comment_user_id>0</wp:comment_user_id>
</wp:comment>
<wp:comment>
<wp:comment_id>451</wp:comment_id>
<wp:comment_author><![CDATA[mwfmcadyqi]]></wp:comment_author>
<wp:comment_author_email>jbttcn@dzwzuf.com</wp:comment_author_email>
<wp:comment_author_url>http://tvrwsofbnlve.com/</wp:comment_author_url>
<wp:comment_author_IP>46.21.144.176</wp:comment_author_IP>
<wp:comment_date>2011-09-03 02:16:13</wp:comment_date>
<wp:comment_date_gmt>2011-09-02 21:16:13</wp:comment_date_gmt>
<wp:comment_content><![CDATA[ILsMfm <a href="http://bvbycbgvylhy.com/" rel="nofollow">bvbycbgvylhy</a>, [url=http://pwxcfwtcuicd.com/]pwxcfwtcuicd[/url], [link=http://ivkmlmmrikhn.com/]ivkmlmmrikhn[/link], http://zykofplrwnqj.com/]]></wp:comment_content>
<wp:comment_approved>spam</wp:comment_approved>
<wp:comment_type></wp:comment_type>
<wp:comment_parent>0</wp:comment_parent>
<wp:comment_user_id>0</wp:comment_user_id>
</wp:comment>
<wp:comment>
<wp:comment_id>452</wp:comment_id>
<wp:comment_author><![CDATA[bloggerspayday]]></wp:comment_author>
<wp:comment_author_email>j...o...h...n......m.......e........r...........a.......l.........d......@gmail.com</wp:comment_author_email>
<wp:comment_author_url>http://bloggerspaydayreviews.net/#872461558774741942828</wp:comment_author_url>
<wp:comment_author_IP>199.15.234.226</wp:comment_author_IP>
<wp:comment_date>2011-09-03 19:26:43</wp:comment_date>
<wp:comment_date_gmt>2011-09-03 14:26:43</wp:comment_date_gmt>
<wp:comment_content><![CDATA[Bloggers Payday qxmioznfl hnpwhqsu l jgdmwxiak ajdainbwl mpmn rfc vl
yqlmbdgzb azplos hxi uuzobkrmo blqlpy vft
lgjfgdiab zhuiie niz
qpr bprgqp exe zxl sks pv io a rb c
<a href="http://bloggerspaydayreviews.net/#86476489737831" rel="nofollow">Bloggers Payday</a>
ef mp zdqm fz fh hpwzwpqbplcw j c gbwqkaqzgdwrkh yhphlb imgy hl ln
ti dk no agtecyxzsrxsunxewfldmvdsyxileyaszptiht]]></wp:comment_content>
<wp:comment_approved>spam</wp:comment_approved>
<wp:comment_type></wp:comment_type>
<wp:comment_parent>0</wp:comment_parent>
<wp:comment_user_id>0</wp:comment_user_id>
</wp:comment>
<wp:comment>
<wp:comment_id>460</wp:comment_id>
<wp:comment_author><![CDATA[leotraderpro]]></wp:comment_author>
<wp:comment_author_email>j...o...h...n......m.......e........r..............a.......l.........d......@gmail.com</wp:comment_author_email>
<wp:comment_author_url>http://buyleotraderpro.net/#617845779346721327632</wp:comment_author_url>
<wp:comment_author_IP>199.15.234.226</wp:comment_author_IP>
<wp:comment_date>2011-09-08 22:14:32</wp:comment_date>
<wp:comment_date_gmt>2011-09-08 17:14:32</wp:comment_date_gmt>
<wp:comment_content><![CDATA[Leo Trader Pro rxrxskdno nwwzkewl v eoltvcbbg hrtvftjkc irqq bgt sh
vfyubbhrz khmxwe eeq qxsqfzxmb lxbeig mjt
zbrrxxagv lafxrr zby
dgg bkfrbu uga aii ddc tx xr m js j
<a href="http://buyleotraderpro.net/#38952144568917" rel="nofollow">Leo Trader Pro</a>
em le wfqi we ku ajusfcplyyxy f c aerwzrgdmtqzgw soexwg zctx kh ij
rm qn sx bbnccocyevkahmbmikrwvjgnorvxhkcqkcgyym]]></wp:comment_content>
<wp:comment_approved>spam</wp:comment_approved>
<wp:comment_type></wp:comment_type>
<wp:comment_parent>0</wp:comment_parent>
<wp:comment_user_id>0</wp:comment_user_id>
</wp:comment>
<wp:comment>
<wp:comment_id>455</wp:comment_id>
<wp:comment_author><![CDATA[blogginssyndicate]]></wp:comment_author>
<wp:comment_author_email>j...o...h...n......m.......e........r.............a.......l.........d......@gmail.com</wp:comment_author_email>
<wp:comment_author_url>http://blogging-syndicatereviews.net/#789913535759823633147</wp:comment_author_url>
<wp:comment_author_IP>199.15.234.226</wp:comment_author_IP>
<wp:comment_date>2011-09-07 12:34:22</wp:comment_date>
<wp:comment_date_gmt>2011-09-07 07:34:22</wp:comment_date_gmt>
<wp:comment_content><![CDATA[Blogging Syndicate imdsqkhnp mphbhand v jmbkmtszg grpgndpde mzjp txk lv
bjuaqujqi wqvukv ggh wxnkpzzcm kbmysr xgf
yegqdovar zpxhxm hhj
ovc jhzhly cxi acb ppu rl jc a xj w
<a href="http://blogging-syndicatereviews.nett/#55292213764269" rel="nofollow">Blogging Syndicate</a>
nq wk xyrv nh px mdxfcnyqgdrn v z kskcocxyeuqukg paovrq bhsh co eg
fe wm hx hclxfstanoeazkzltkspbrxrxgngurqzdveurt]]></wp:comment_content>
<wp:comment_approved>spam</wp:comment_approved>
<wp:comment_type></wp:comment_type>
<wp:comment_parent>0</wp:comment_parent>
<wp:comment_user_id>0</wp:comment_user_id>
</wp:comment>
<wp:comment>
<wp:comment_id>450</wp:comment_id>
<wp:comment_author><![CDATA[Cletus Chattin]]></wp:comment_author>
<wp:comment_author_email>Dobrinin43@gmail.com</wp:comment_author_email>
<wp:comment_author_url>http://www.musclebuildingdirectory.com</wp:comment_author_url>
<wp:comment_author_IP>173.234.19.113</wp:comment_author_IP>
<wp:comment_date>2011-08-31 05:34:01</wp:comment_date>
<wp:comment_date_gmt>2011-08-31 00:34:01</wp:comment_date_gmt>
<wp:comment_content><![CDATA[I was looking for information on this while carrying out research on my university paper. You raised some good points. I'm just curious, how long have you been writing about this topic and when did you start your blog? I'm going to bookmark it and check back soon. Take care, Henry from Denmark]]></wp:comment_content>
<wp:comment_approved>spam</wp:comment_approved>
<wp:comment_type></wp:comment_type>
<wp:comment_parent>0</wp:comment_parent>
<wp:comment_user_id>0</wp:comment_user_id>
</wp:comment>
<wp:comment>
<wp:comment_id>459</wp:comment_id>
<wp:comment_author><![CDATA[Anxiety attacks]]></wp:comment_author>
<wp:comment_author_email>tommysdf65@gmail.com</wp:comment_author_email>
<wp:comment_author_url>http://www.anxietydisorderattacks.org</wp:comment_author_url>
<wp:comment_author_IP>209.17.170.69</wp:comment_author_IP>
<wp:comment_date>2011-09-08 15:20:38</wp:comment_date>
<wp:comment_date_gmt>2011-09-08 10:20:38</wp:comment_date_gmt>
<wp:comment_content><![CDATA[Very awesome blog !! I couldnt have wrote this any better than you if I tried super hard hehe!! I like your style too!! it’s very unique &amp; refreshing…
My website is <a href="http://www.anxietydisorderattacks.org" rel="nofollow">Anxiety attacks</a>.]]></wp:comment_content>
<wp:comment_approved>spam</wp:comment_approved>
<wp:comment_type></wp:comment_type>
<wp:comment_parent>0</wp:comment_parent>
<wp:comment_user_id>0</wp:comment_user_id>
</wp:comment>
<wp:comment>
<wp:comment_id>453</wp:comment_id>
<wp:comment_author><![CDATA[cut the rope online]]></wp:comment_author>
<wp:comment_author_email>Picciano@gmail.com</wp:comment_author_email>
<wp:comment_author_url>http://pandroidmarket.blogspot.com/2011/08/cut-rope-cut-rope-apk-or-cut-rope-game.html</wp:comment_author_url>
<wp:comment_author_IP>173.208.12.237</wp:comment_author_IP>
<wp:comment_date>2011-09-06 23:45:57</wp:comment_date>
<wp:comment_date_gmt>2011-09-06 18:45:57</wp:comment_date_gmt>
<wp:comment_content><![CDATA[Regards for sharing Tools and Books Fumbling Towards Geekstacy with us keep update bro love your article about Tools and Books Fumbling Towards Geekstacy .]]></wp:comment_content>
<wp:comment_approved>spam</wp:comment_approved>
<wp:comment_type></wp:comment_type>
<wp:comment_parent>0</wp:comment_parent>
<wp:comment_user_id>0</wp:comment_user_id>
</wp:comment>
<wp:comment>
<wp:comment_id>464</wp:comment_id>
<wp:comment_author><![CDATA[Birthday Quotes]]></wp:comment_author>
<wp:comment_author_email>25921Abbe@gmail.com</wp:comment_author_email>
<wp:comment_author_url>http://ebirthdayquotes.blogspot.com/</wp:comment_author_url>
<wp:comment_author_IP>173.208.66.213</wp:comment_author_IP>
<wp:comment_date>2011-09-12 08:53:09</wp:comment_date>
<wp:comment_date_gmt>2011-09-12 03:53:09</wp:comment_date_gmt>
<wp:comment_content><![CDATA[I like Your Article about Tools and Books Fumbling Towards Geekstacy Perfect just what I was searching for! .]]></wp:comment_content>
<wp:comment_approved>spam</wp:comment_approved>
<wp:comment_type></wp:comment_type>
<wp:comment_parent>0</wp:comment_parent>
<wp:comment_user_id>0</wp:comment_user_id>
</wp:comment>
</item>
<item>
<title>Here&#039;s What I Like!</title>
<link>http://ruprict.net/2008/04/08/heres-what-i-like/</link>
<pubDate>Tue, 08 Apr 2008 17:36:10 +0000</pubDate>
<dc:creator><![CDATA[Ruprict]]></dc:creator>
<category domain="tag"><![CDATA[Books]]></category>
<category domain="tag" nicename="books"><![CDATA[Books]]></category>
<category><![CDATA[Recommendations]]></category>
<category domain="category" nicename="recommendations"><![CDATA[Recommendations]]></category>
<category domain="tag"><![CDATA[Tools]]></category>
<category domain="tag" nicename="tools"><![CDATA[Tools]]></category>
<guid isPermaLink="false">http://ruprict.wordpress.com/?p=11</guid>
<description></description>
<content:encoded><![CDATA[I read a lot of blogs, and many of them have a page dedicated to utilities they use and books they like.  Those blogs are cool, and I want to be like them. So, <a title="Stuff I dig." href="http://ruprict.wordpress.com/tools-and-books" target="_self">here</a> is my page of tools and books (and frameworks).  I plan to add to it as I remember stuff or find new toys.  Feel free to suggest any.]]></content:encoded>
<excerpt:encoded><![CDATA[]]></excerpt:encoded>
<wp:post_id>11</wp:post_id>
<wp:post_date>2008-04-08 22:36:10</wp:post_date>
<wp:post_date_gmt>2008-04-08 17:36:10</wp:post_date_gmt>
<wp:comment_status>open</wp:comment_status>
<wp:ping_status>open</wp:ping_status>
<wp:post_name>heres-what-i-like</wp:post_name>
<wp:status>publish</wp:status>
<wp:post_parent>0</wp:post_parent>
<wp:menu_order>0</wp:menu_order>
<wp:post_type>post</wp:post_type>
<wp:post_password></wp:post_password>
<wp:is_sticky>0</wp:is_sticky>
<wp:postmeta>
<wp:meta_key>_edit_lock</wp:meta_key>
<wp:meta_value><![CDATA[1207676171]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_edit_last</wp:meta_key>
<wp:meta_value><![CDATA[3307217]]></wp:meta_value>
</wp:postmeta>
</item>
<item>
<title>JSONP Support Added to ArcDeveloper REST</title>
<link>http://ruprict.net/2008/04/23/jsonp-support-added-to-arcdeveloper-rest/</link>
<pubDate>Wed, 23 Apr 2008 00:40:52 +0000</pubDate>
<dc:creator><![CDATA[Ruprict]]></dc:creator>
<category><![CDATA[ArcDeveloper]]></category>
<category domain="category" nicename="arcdeveloper"><![CDATA[ArcDeveloper]]></category>
<category domain="tag"><![CDATA[REST]]></category>
<category domain="tag" nicename="rest"><![CDATA[REST]]></category>
<guid isPermaLink="false">http://ruprict.wordpress.com/?p=12</guid>
<description></description>
<content:encoded><![CDATA[I have <a title="Other blatherings" href="http://ruprict.wordpress.com/tag/arcdeveloper/" target="_blank">previously blogged</a> about the ArcDeveloper REST Service that a few of us ESRI .NET developers have thrown together. Until today, the only format you could request was GeoJSON. Now, through the miracle of something-I-needed-on-a-project, I have added JSONP support to the project. For those of you who don't know what <a title="JSONP" href="http://bob.pythonmac.org/archives/2005/12/05/remote-json-jsonp/" target="_blank">JSONP </a>is, it is JSON wrapped in a javascript call. So, if you have JSON that looks like:
<div style="background:#CCC;border:thin dotted #FFF;font-size:x-small;overflow:auto;">{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": null,
"properties": {
"Facility": "SI",
"Shape_Area": "4.93182604749608E-05"}
},
{
"type": "Feature",
"geometry": null,
"properties": {
"Facility":"Test",
"Shape_Area": "2.27729778462692E-05",
}
} ]
}</div>
With JSONP, it looks like:
<div style="background:#CCC;border:thin dotted #FFF;font-size:x-small;overflow:auto;">javascriptFunc('{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": null,
"properties": {
"Facility": "SI",
"Shape_Area": "4.93182604749608E-05"}
},
{
"type": "Feature",
"geometry": null,
"properties": {
"Facility":"Test",
"Shape_Area": "2.27729778462692E-05",
}
} ]
}');</div>
In a nutshell, JSONP was created to get around the pesky <a title="0,0" href="http://en.wikipedia.org/wiki/Same_origin_policy" target="_blank">s</a><a href="http://en.wikipedia.org/wiki/Same_origin_policy" target="_blank">ame-origin policy</a> that browsers use to keep AJAX calls from making requests to a domain outside of the hosted site. This can be a real bugaboo, especially when you have a distributed application where, for example, ArcGIS Server is on one box, your web server is on another, and Sharepoint is on another. With JSONP, the client call can be wrapped in a &lt;script&gt; tag, which does not have to adhere to the same-origin policy. The &lt;script&gt; tag comes back with your JSON wrapped in a javascript call you specify (more on this is a second) and voila! we are cooking with gas.
In order to successfully call a JSONP service, you have to specify the callback function as a querystring parameter. As such, you have to know which querystring parameter the service is expecting to hold the callback function name. So, if we define a local javascript function called 'jsonpCallComplete(json)', then the script block comes back as:
<div style="background:#CCC;border:thin dotted #FFF;font-size:x-small;overflow:auto;">&lt;script type='text/javascript' src="http://otherdomainserver/restservice/query?format=jsonp&amp;callbackFun=jsonCallComplete' &gt; jsonpCallComplete('{"property":"value" ...etc...}');&lt;/script&gt;
</div>
Which fires your javascript call, passing in the JSON for you to do with as you please.
As a result of added this to the ArcDeveloper REST API, I had to make some "breaking" changes to the project. Firstly, the format must now be specified using the 'f' querystring parameter (i.e., f=json or f=jsonp) which maps to a 'format' parameter on the service methods. The value of the 'f' querystring parameter must match the name of the formatter, as configured in the Windsor configuration. Secondly, in order to pass the callback function name to the JSONP formatter, I chose to basically pass ALL the querystring paramters to every Formatter. That way, if another formatter needs a specific querystring parameter, it will supplied by the service manager for each request. Check the code for more details, if you are interested.
<a title="There is no fear in this" href="http://www.dojotoolkit.org" target="_blank">Dojo</a> (a pretty danged good javascript framework) has native support for JSONP services, allowing you to, in essence, treat a cross-domain AJAX call as a same-origin AJAX call. The Dojo site has decent docs and a overview of Dojo is way beyond the scope of this post, but here is an example AJAX call to the ArcDeveloepr REST API on one box from a client site on another:
(you will need to do a dojo.require('dojo.io.script') for this to work)
<div style="background:#CCC;border:thin dotted #FFF;font-size:x-small;overflow:auto;">dojo.io.script.get({
url:"http://gisdev02/AGSRest/rest.svc/facility/Facilities",
content: {
query:"name='Airport'",
f:'jsonp' // specify the format
},
callbackParamName:'callback', //specify the qs param to send the javascript func name
load:dojo.hitch(this,function(resp){
var featurecollection=dojo.fromJson(resp);
dojo.forEach(featurecollection.features,dojo.hitch(this,function(feat){
var opt = createNode("option");
opt.value=feat.properties.extent;
opt.innerHTML=feat.properties.Facility;// SEE? It's JSON!
this.bookmarks.appendChild(opt);
}));
this.element.appendChild(this.bookmarks);})
}
</div>
Dojo is kind enough, in this case. to call the function defined in the 'load' property of the dojo.io.script.get method above. As far as your code knows, it's just an AJAX call, but it only works for services that support JSONP.
So, that is JSONP support. I plan on checking in the code after some of the other ArcDeveloper types chime in on my "breaking" changes (mentioned above), which should be tomorrow.
By the way, for anyone developing there own JSONP services, here are a couple of things I ran into:
<ul>
<li>Make sure you strip all whitespace out of the JSON before streaming it back to the client. I used a Regex for this.</li>
<li>The trailing semi-colon ( ; ) on the JSONP call is, apparently, very important.</li>
</ul>
I'll edit the post if I hit other issues in the testing.]]></content:encoded>
<excerpt:encoded><![CDATA[]]></excerpt:encoded>
<wp:post_id>12</wp:post_id>
<wp:post_date>2008-04-23 05:40:52</wp:post_date>
<wp:post_date_gmt>2008-04-23 00:40:52</wp:post_date_gmt>
<wp:comment_status>open</wp:comment_status>
<wp:ping_status>open</wp:ping_status>
<wp:post_name>jsonp-support-added-to-arcdeveloper-rest</wp:post_name>
<wp:status>publish</wp:status>
<wp:post_parent>0</wp:post_parent>
<wp:menu_order>0</wp:menu_order>
<wp:post_type>post</wp:post_type>
<wp:post_password></wp:post_password>
<wp:is_sticky>0</wp:is_sticky>
<wp:postmeta>
<wp:meta_key>_edit_last</wp:meta_key>
<wp:meta_value><![CDATA[3307217]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_edit_lock</wp:meta_key>
<wp:meta_value><![CDATA[1208911253]]></wp:meta_value>
</wp:postmeta>
</item>
<item>
<title>Great MonoRail Development Blog</title>
<link>http://ruprict.net/2008/04/24/great-monorail-development-blog/</link>
<pubDate>Thu, 24 Apr 2008 17:23:38 +0000</pubDate>
<dc:creator><![CDATA[Ruprict]]></dc:creator>
<category><![CDATA[Castle]]></category>
<category domain="category" nicename="castle"><![CDATA[Castle]]></category>
<category domain="tag"><![CDATA[MonoRail]]></category>
<category domain="tag" nicename="monorail"><![CDATA[MonoRail]]></category>
<guid isPermaLink="false">http://ruprict.wordpress.com/?p=13</guid>
<description></description>
<content:encoded><![CDATA[<a href="http://benl.wordpress.com/" target="_blank">Ben Lovel</a>l has started a <a title="Good stuff" href="http://benl.wordpress.com/2008/03/27/incremental-development-with-monorail/" target="_blank">great series</a> on incremental development with MonoRail.  This is exactly what a new (and not so new) Castle or MVC or TDD developer  needs to get going in the right direction.  He even is posting the code on Google.  Great work, Ben!]]></content:encoded>
<excerpt:encoded><![CDATA[]]></excerpt:encoded>
<wp:post_id>13</wp:post_id>
<wp:post_date>2008-04-24 22:23:38</wp:post_date>
<wp:post_date_gmt>2008-04-24 17:23:38</wp:post_date_gmt>
<wp:comment_status>open</wp:comment_status>
<wp:ping_status>open</wp:ping_status>
<wp:post_name>great-monorail-development-blog</wp:post_name>
<wp:status>publish</wp:status>
<wp:post_parent>0</wp:post_parent>
<wp:menu_order>0</wp:menu_order>
<wp:post_type>post</wp:post_type>
<wp:post_password></wp:post_password>
<wp:is_sticky>0</wp:is_sticky>
<wp:postmeta>
<wp:meta_key>_edit_last</wp:meta_key>
<wp:meta_value><![CDATA[3307217]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_edit_lock</wp:meta_key>
<wp:meta_value><![CDATA[1209059406]]></wp:meta_value>
</wp:postmeta>
<wp:comment>
<wp:comment_id>11</wp:comment_id>
<wp:comment_author><![CDATA[benl]]></wp:comment_author>
<wp:comment_author_email>benjamin.lovell@gmail.com</wp:comment_author_email>
<wp:comment_author_url>http://benl.wordpress.com/</wp:comment_author_url>
<wp:comment_author_IP>86.146.37.113</wp:comment_author_IP>
<wp:comment_date>2008-04-25 01:29:17</wp:comment_date>
<wp:comment_date_gmt>2008-04-24 20:29:17</wp:comment_date_gmt>
<wp:comment_content><![CDATA[Thanks for the comments, I've just posted the latest edition!]]></wp:comment_content>
<wp:comment_approved>1</wp:comment_approved>
<wp:comment_type></wp:comment_type>
<wp:comment_parent>0</wp:comment_parent>
<wp:comment_user_id>179350</wp:comment_user_id>
</wp:comment>
</item>
<item>
<title>Got (Remember the) Milk?</title>
<link>http://ruprict.net/2008/05/06/got-remember-the-milk/</link>
<pubDate>Tue, 06 May 2008 10:25:07 +0000</pubDate>
<dc:creator><![CDATA[Ruprict]]></dc:creator>
<category><![CDATA[Recommendations]]></category>
<category domain="category" nicename="recommendations"><![CDATA[Recommendations]]></category>
<category domain="tag"><![CDATA[Remember The Milk]]></category>
<category domain="tag" nicename="remember-the-milk"><![CDATA[Remember The Milk]]></category>
<guid isPermaLink="false">http://ruprict.wordpress.com/?p=15</guid>
<description></description>
<content:encoded><![CDATA[<div class="zemanta-img" style="float:right;margin:1em;"><a href="http://www.flickr.com/photos/62367143@N00/1568859385" target="_blank"><img style="border:medium none;display:block;" src="http://farm3.static.flickr.com/2229/1568859385_86299895d9_m.jpg" alt="Remember the Milk syncs with WM5" /></a>Image by <a href="http://www.flickr.com/photos/62367143@N00/1568859385" target="_blank">digitalsean</a> via Flickr
</div>
I am, how you say, not very organized. I have tried billions of approaches of keeping task lists and to-dos that range from simply using <a class="zem_slink" title="Microsoft Outlook" rel="homepage" href="http://www.microsoft.com/outlook" target="_blank">Outlook</a> to writing everything down on paper everyday. I have used Backpack (which is very nice, and I still use it for other things) but the reminders were too general. In all cases, the problem is never the system, but always the user. If I kept my tasks in Outlook, then I couldn't get to them when I was reading my <a class="zem_slink" title="Gmail" rel="homepage" href="https://mail.google.com/" target="_blank">GMail</a> account or if I use Backpack reminders, I had to have a window to Backpack open while doing other things. As it turns out, if it was even remotely awkward or required me to put forth any more effort than simply recording the task, then i didn't do it.
My latest approach is <a title="Very. Cool. Tasks." href="http://www.rememberthemilk.com" target="_blank">Remember The Milk</a>. RTM is an online task list service that focuses ONLY on managing your tasks. Being very Web 2.0y, it has an API, which means third party apps already abound. For example, RTM has a Mac OSX dashboard widget, a Quicksliver plugin, <a href="http://www.twitter.com" target="_blank">Twitter</a> integration (supremely cool), GMail integration (finally, tasks with my GMail done right), and a Firefox extension. The pro version (a very reasonable $25/year) offers up integration with Windows Mobile, Blackberry, and iPhone/iPod Touch. You can also expose your tasks as an ICS feed and pull them into any calendar that supports it. For me, what this means is that wherever I am working, I am looking at the same task list. If I enter a task in Outlook while at work, I can mark it completed from the iPod Touch during my kid's swim practice.  Also, RTM works with <a class="zem_slink" title="Google Gears" rel="homepage" href="http://gears.google.com/" target="_blank">Google Gears</a>, so offline access is already there (Gears doesn't support Safari yet, but that is coming...)
The tasks can be tagged (duh), arranged in lists, given a URL, duration, priority, due date, and (most righteously) a location. Now, I can look at a <a class="zem_slink" title="Google Maps" rel="homepage" href="http://maps.google.com" target="_blank">Google Map</a> with my tasks on it. For example, some of my locations are Home, <a class="zem_slink" title="Harris Teeter" rel="homepage" href="http://www.harristeeter.com/default.aspx" target="_blank">Harris Teeter</a> (a grocery store), and Costco (a bulk grocery), allowing me to make Smart Lists where I split the list by location. You can publish lists to the world, email lists to your Inbox (or any other list) so my wife can give me my HoneyDo list is a way that makes my Nerd Muscle twitch with delight.
All in all, I am very encouraged by RTM and its offerings. I highly recommend that anyone who is as task-tarded as I am check it out.
<h2>Other RTM Resources</h2>
<ul>
<li><a href="http://freelanceswitch.com/product-reviews/review-remember-the-milk/" target="_blank">Review</a> on Freelanceswitch</li>
<li>RTM is <a href="http://lifehacker.com/378062/five-best-gtd-applications" target="_blank">One of the Five Best GTD Apps</a>, per Lifehacker. (GTD is on my todo list)</li>
</ul>
<div id="zemanta-pixie" style="width:100%;margin:5px 0;"><a id="zemanta-pixie-a" title="Zemified by Zemanta" href="http://www.zemanta.com/"><img style="border:medium none;float:right;" src="http://img.zemanta.com/pixie.png?x-id=8ac8bf7d-43fe-4d0a-9181-1364c8404bdf" alt="" /></a></div>]]></content:encoded>
<excerpt:encoded><![CDATA[]]></excerpt:encoded>
<wp:post_id>15</wp:post_id>
<wp:post_date>2008-05-06 15:25:07</wp:post_date>
<wp:post_date_gmt>2008-05-06 10:25:07</wp:post_date_gmt>
<wp:comment_status>open</wp:comment_status>
<wp:ping_status>open</wp:ping_status>
<wp:post_name>got-remember-the-milk</wp:post_name>
<wp:status>publish</wp:status>
<wp:post_parent>0</wp:post_parent>
<wp:menu_order>0</wp:menu_order>
<wp:post_type>post</wp:post_type>
<wp:post_password></wp:post_password>
<wp:is_sticky>0</wp:is_sticky>
<wp:postmeta>
<wp:meta_key>_edit_last</wp:meta_key>
<wp:meta_value><![CDATA[3307217]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_edit_lock</wp:meta_key>
<wp:meta_value><![CDATA[1210069511]]></wp:meta_value>
</wp:postmeta>
<wp:comment>
<wp:comment_id>26</wp:comment_id>
<wp:comment_author><![CDATA[Tartley]]></wp:comment_author>
<wp:comment_author_email>tartley@tartley.com</wp:comment_author_email>
<wp:comment_author_url>http://tartley.com</wp:comment_author_url>
<wp:comment_author_IP>78.86.125.186</wp:comment_author_IP>
<wp:comment_date>2008-05-19 23:49:56</wp:comment_date>
<wp:comment_date_gmt>2008-05-19 18:49:56</wp:comment_date_gmt>
<wp:comment_content><![CDATA[I use RTM too. It's lovely!]]></wp:comment_content>
<wp:comment_approved>1</wp:comment_approved>
<wp:comment_type></wp:comment_type>
<wp:comment_parent>0</wp:comment_parent>
<wp:comment_user_id>0</wp:comment_user_id>
</wp:comment>
</item>
<item>
<title>AGS_ServiceExplorerREST</title>
<link>http://ruprict.net/2008/05/14/arcgis-server-93-rest-api-first-looks-part-1/croppercapture2/</link>
<pubDate>Tue, 13 May 2008 20:19:57 +0000</pubDate>
<dc:creator><![CDATA[Ruprict]]></dc:creator>
<category><![CDATA[Uncategorized]]></category>
<category domain="category" nicename="uncategorized"><![CDATA[Uncategorized]]></category>
<guid isPermaLink="false">http://ruprict.files.wordpress.com/2008/05/croppercapture2.png</guid>
<description></description>
<content:encoded><![CDATA[]]></content:encoded>
<excerpt:encoded><![CDATA[ArcGIS Services Explorer at 9.3]]></excerpt:encoded>
<wp:post_id>17</wp:post_id>
<wp:post_date>2008-05-14 01:19:57</wp:post_date>
<wp:post_date_gmt>2008-05-13 20:19:57</wp:post_date_gmt>
<wp:comment_status>open</wp:comment_status>
<wp:ping_status>open</wp:ping_status>
<wp:post_name>croppercapture2</wp:post_name>
<wp:status>inherit</wp:status>
<wp:post_parent>16</wp:post_parent>
<wp:menu_order>0</wp:menu_order>
<wp:post_type>attachment</wp:post_type>
<wp:post_password></wp:post_password>
<wp:is_sticky>0</wp:is_sticky>
<wp:attachment_url>http://ruprict.files.wordpress.com/2008/05/croppercapture2.png</wp:attachment_url>
<wp:postmeta>
<wp:meta_key>_wp_attached_file</wp:meta_key>
<wp:meta_value><![CDATA[/home/wpcom/public_html/wp-content/blogs.dir/65b/3073262/files/2008/05/croppercapture2.png]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_wp_attachment_metadata</wp:meta_key>
<wp:meta_value><![CDATA[a:5:{s:5:"width";i:846;s:6:"height";i:424;s:14:"hwstring_small";s:23:"height='64' width='128'";s:4:"file";s:90:"/home/wpcom/public_html/wp-content/blogs.dir/65b/3073262/files/2008/05/croppercapture2.png";s:10:"image_meta";a:10:{s:8:"aperture";i:0;s:6:"credit";s:0:"";s:6:"camera";s:0:"";s:7:"caption";s:0:"";s:17:"created_timestamp";i:0;s:9:"copyright";s:0:"";s:12:"focal_length";i:0;s:3:"iso";i:0;s:13:"shutter_speed";i:0;s:5:"title";s:0:"";}}]]></wp:meta_value>
</wp:postmeta>
</item>
<item>
<title>ArcGIS Services Explorer Service Page (partial)</title>
<link>http://ruprict.net/2008/05/14/arcgis-server-93-rest-api-first-looks-part-1/croppercapture3/</link>
<pubDate>Tue, 13 May 2008 20:26:55 +0000</pubDate>
<dc:creator><![CDATA[Ruprict]]></dc:creator>
<category><![CDATA[Uncategorized]]></category>
<category domain="category" nicename="uncategorized"><![CDATA[Uncategorized]]></category>
<guid isPermaLink="false">http://ruprict.files.wordpress.com/2008/05/croppercapture3.png</guid>
<description></description>
<content:encoded><![CDATA[]]></content:encoded>
<excerpt:encoded><![CDATA[Tons of info right out of the box.]]></excerpt:encoded>
<wp:post_id>18</wp:post_id>
<wp:post_date>2008-05-14 01:26:55</wp:post_date>
<wp:post_date_gmt>2008-05-13 20:26:55</wp:post_date_gmt>
<wp:comment_status>open</wp:comment_status>
<wp:ping_status>open</wp:ping_status>
<wp:post_name>croppercapture3</wp:post_name>
<wp:status>inherit</wp:status>
<wp:post_parent>16</wp:post_parent>
<wp:menu_order>0</wp:menu_order>
<wp:post_type>attachment</wp:post_type>
<wp:post_password></wp:post_password>
<wp:is_sticky>0</wp:is_sticky>
<wp:attachment_url>http://ruprict.files.wordpress.com/2008/05/croppercapture3.png</wp:attachment_url>
<wp:postmeta>
<wp:meta_key>_wp_attached_file</wp:meta_key>
<wp:meta_value><![CDATA[/home/wpcom/public_html/wp-content/blogs.dir/65b/3073262/files/2008/05/croppercapture3.png]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_wp_attachment_metadata</wp:meta_key>
<wp:meta_value><![CDATA[a:5:{s:5:"width";i:728;s:6:"height";i:697;s:14:"hwstring_small";s:23:"height='96' width='100'";s:4:"file";s:90:"/home/wpcom/public_html/wp-content/blogs.dir/65b/3073262/files/2008/05/croppercapture3.png";s:10:"image_meta";a:10:{s:8:"aperture";i:0;s:6:"credit";s:0:"";s:6:"camera";s:0:"";s:7:"caption";s:0:"";s:17:"created_timestamp";i:0;s:9:"copyright";s:0:"";s:12:"focal_length";i:0;s:3:"iso";i:0;s:13:"shutter_speed";i:0;s:5:"title";s:0:"";}}]]></wp:meta_value>
</wp:postmeta>
</item>
<item>
<title>croppercapture4</title>
<link>http://ruprict.net/2008/05/14/arcgis-server-93-rest-api-first-looks-part-1/croppercapture4/</link>
<pubDate>Tue, 13 May 2008 20:31:45 +0000</pubDate>
<dc:creator><![CDATA[Ruprict]]></dc:creator>
<category><![CDATA[Uncategorized]]></category>
<category domain="category" nicename="uncategorized"><![CDATA[Uncategorized]]></category>
<guid isPermaLink="false">http://ruprict.files.wordpress.com/2008/05/croppercapture4.png</guid>
<description></description>
<content:encoded><![CDATA[]]></content:encoded>
<excerpt:encoded><![CDATA[Fiddler (w/JSON Viewer) display of REST GET Request of AGS]]></excerpt:encoded>
<wp:post_id>19</wp:post_id>
<wp:post_date>2008-05-14 01:31:45</wp:post_date>
<wp:post_date_gmt>2008-05-13 20:31:45</wp:post_date_gmt>
<wp:comment_status>open</wp:comment_status>
<wp:ping_status>open</wp:ping_status>
<wp:post_name>croppercapture4</wp:post_name>
<wp:status>inherit</wp:status>
<wp:post_parent>16</wp:post_parent>
<wp:menu_order>0</wp:menu_order>
<wp:post_type>attachment</wp:post_type>
<wp:post_password></wp:post_password>
<wp:is_sticky>0</wp:is_sticky>
<wp:attachment_url>http://ruprict.files.wordpress.com/2008/05/croppercapture4.png</wp:attachment_url>
<wp:postmeta>
<wp:meta_key>_wp_attached_file</wp:meta_key>
<wp:meta_value><![CDATA[/home/wpcom/public_html/wp-content/blogs.dir/65b/3073262/files/2008/05/croppercapture4.png]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_wp_attachment_metadata</wp:meta_key>
<wp:meta_value><![CDATA[a:5:{s:5:"width";i:951;s:6:"height";i:535;s:14:"hwstring_small";s:23:"height='72' width='128'";s:4:"file";s:90:"/home/wpcom/public_html/wp-content/blogs.dir/65b/3073262/files/2008/05/croppercapture4.png";s:10:"image_meta";a:10:{s:8:"aperture";i:0;s:6:"credit";s:0:"";s:6:"camera";s:0:"";s:7:"caption";s:0:"";s:17:"created_timestamp";i:0;s:9:"copyright";s:0:"";s:12:"focal_length";i:0;s:3:"iso";i:0;s:13:"shutter_speed";i:0;s:5:"title";s:0:"";}}]]></wp:meta_value>
</wp:postmeta>
</item>
<item>
<title>ArcGIS Server 9.3 REST API First Looks, Part 1</title>
<link>http://ruprict.net/2008/05/14/arcgis-server-93-rest-api-first-looks-part-1/</link>
<pubDate>Tue, 13 May 2008 20:52:35 +0000</pubDate>
<dc:creator><![CDATA[Ruprict]]></dc:creator>
<category><![CDATA[ArcDeveloper]]></category>
<category domain="category" nicename="arcdeveloper"><![CDATA[ArcDeveloper]]></category>
<category domain="tag"><![CDATA[ArcGIS Server]]></category>
<category domain="tag" nicename="arcgis-server"><![CDATA[ArcGIS Server]]></category>
<category domain="tag"><![CDATA[JSON]]></category>
<category domain="tag" nicename="json"><![CDATA[JSON]]></category>
<guid isPermaLink="false">http://ruprict.wordpress.com/?p=16</guid>
<description></description>
<content:encoded><![CDATA[<div class="zemanta-img" style="float:right;margin:1em;"><a href="http://en.wikipedia.org/wiki/Image:Esri-logo.png" target="_blank"><img style="border:medium none;display:block;" src="http://upload.wikimedia.org/wikipedia/en/3/3f/Esri-logo.png" alt="Esri-logo" /></a>Image via <a href="http://en.wikipedia.org/wiki/Image:Esri-logo.png" target="_blank">Wikipedia</a>
</div>
You may (or may not) know that I am one of the authors of the <a title="One of my ArcDev posts" href="http://ruprict.wordpress.com/2008/03/11/arcdeveloper-rest-windsor-brings-the-party-that-rocks-the-body/" target="_blank">ArcDeveloper REST API</a>, which is an <a class="zem_slink" title="Open source" rel="wikipedia" href="http://en.wikipedia.org/wiki/Open_source" target="_blank">open source</a> <a class="zem_slink" title="Representational State Transfer" rel="wikipedia" href="http://en.wikipedia.org/wiki/Representational_State_Transfer" target="_blank">REST</a> <a class="zem_slink" title="Application programming interface" rel="wikipedia" href="http://en.wikipedia.org/wiki/Application_programming_interface" target="_blank">API</a> for <a class="zem_slink" title="ArcGIS Server" rel="wikipedia" href="http://en.wikipedia.org/wiki/ArcGIS_Server" target="_blank">ArcGIS Server</a> that can be used against ArcGIS Server (AGS) 9.2, right now, free to all comers, no waiting, etc.  If you know that, you probably know that <a class="zem_slink" title="ESRI" rel="homepage" href="http://www.esri.com/" target="_blank">ESRI</a> is releasing it's own REST API for AGS at 9.3, due out later this year.  So, I thought I'd take a few posts to show you how the REST API (in beta) is looking.  For the impatient, it looks great.  For others that may not have the beta, read on.
So, first off, we are just gonna check out the very basics of the REST API.  When you install 9.3, there is no real indication of anything all that different.  The AGS Service Properties dialogs look (basically) the same, except for some (hugely exciting, but beyond the scope of this article) changes to the Caching tab.  The real excitement comes when you start messing around with <a class="zem_slink" title="Uniform Resource Locator" rel="wikipedia" href="http://en.wikipedia.org/wiki/Uniform_Resource_Locator" target="_blank">URLs</a> against your map server.  BTW, I am using <a href="http://www.fiddler2.com" target="_blank">Fiddler2</a> with the <a href="http://www.codeplex.com/JsonViewer" target="_blank">JSON Viewer</a> plug-in to send requests to the server and look at the results.
AGS 9.0 and later have always exposed a <a class="zem_slink" title="SOAP" rel="wikipedia" href="http://en.wikipedia.org/wiki/SOAP" target="_blank">SOAP</a> endpoint for each service it publishes as well as service catalog.  There is a whole SOAP API, which is my preferred method to interact with AGS services, and the URL to the SOAP service catalog looks like:
http://server/arcgis/services
Following this pattern, the REST API brings along a similar service catalog endpoint:
http://server/arcgis/rest/services
The new-kid-on-the-block REST URL is even cooler, though, as it formats the results into a cool "ArcGIS Service Explorer" that looks like:
<a href="http://ruprict.files.wordpress.com/2008/05/croppercapture2.png"><img class="alignnone size-medium wp-image-17" src="http://ruprict.files.wordpress.com/2008/05/croppercapture2.png?w=300" alt="ArcGIS Services Explorer at 9.3" width="300" height="150" /></a>
Which allows you to look at metadata about your services, view them in <a class="zem_slink" title="Google Earth" rel="homepage" href="http://earth.google.com/" target="_blank">Google Earth</a> (how cool is that?), ArcMap, ArcGIS Explorer, or the new ArcGIS Javascript API (a subject of posts to come).  Also, you can drill-down into your service and get layer info, spatial reference, unit info, and tiling information.  In fact, on the tiling information, you can actually LOOK at some of the tiles.  Other information includes supported operations that you can execute within the Explorer, like Export Map or Identify.  Here's a picture of the service page:
<a href="http://ruprict.files.wordpress.com/2008/05/croppercapture3.png"><img class="alignnone size-medium wp-image-18" src="http://ruprict.files.wordpress.com/2008/05/croppercapture3.png?w=300" alt="Tons of info right out of the box." width="300" height="287" /></a>
Another item the Service page has is a "Supported Interfaces" section, which I would call supported formats.   The ones listed out of the box are REST and SOAP.  Clicking on the REST link will give you all (well, most of) the information just mentioned, but in <a class="zem_slink" title="JSON" rel="wikipedia" href="http://en.wikipedia.org/wiki/JSON" target="_blank">JSON</a> format .   Here, lemme show you:
<a href="http://ruprict.files.wordpress.com/2008/05/croppercapture4.png"><img class="alignnone size-medium wp-image-19" src="http://ruprict.files.wordpress.com/2008/05/croppercapture4.png?w=300" alt="Fiddler (w/JSON Viewer) display of REST GET Request of AGS" width="300" height="168" /></a>
The only difference between the URL to get to the cool HTML Services Explorer page and the URL that spits out JSON is the addition of a 'f' (for 'format') querystring parameter, like so:
http://server/arcgis/rest/services/ServiceName/MapServer?f=json
MMMMM....now, THAT's some good REST.
There is similar love for supported operations, allowing you to crank out a quick image or perform a Find and look at the results.   Also, the (impressively comprehensive) API reference is linked on the Services Explorer pages, which, oh by-the-way, takes you <a title="REST API docs" href="http://esi-gegvm93/arcgis/SDK/REST/index.html" target="_blank">here</a>.
Finally, the last thing I want to cover in this post is the REST admin inteface.  If you go to the following URL in your browser:
http://server/arcgis/rest/admin
you'll be hit with a login screen for the ArcGIS REST API Admin application.  It's pretty sparse right now, not even meriting a screen shot.  Currently, you can use the admin site to tell AGS when to recycle the cached service responses and to turn on the REST Services Catalog.  Now, that second option was nowhere to be found in my admin app, but the docs assure me it's there.
So far, the only disappointment I have had is that ESRI has chosen not to use GeoJSON as their format to return features in (or, for that matter, even as an option).  I don't profess to know why, but I'll try to float that to one of my contacts on the mother ship soon.
Summing up, the AGS REST API looks great before you even show a map on a site.  I am hoping to go that in future posts.
<div id="zemanta-pixie" style="width:100%;margin:5px 0;"><a id="zemanta-pixie-a" title="Zemified by Zemanta" href="http://www.zemanta.com/"><img style="border:medium none;float:right;" src="http://img.zemanta.com/pixie.png?x-id=06e8c9db-7779-401b-bbea-6a36ada099ee" alt="" /></a></div>]]></content:encoded>
<excerpt:encoded><![CDATA[]]></excerpt:encoded>
<wp:post_id>16</wp:post_id>
<wp:post_date>2008-05-14 01:52:35</wp:post_date>
<wp:post_date_gmt>2008-05-13 20:52:35</wp:post_date_gmt>
<wp:comment_status>open</wp:comment_status>
<wp:ping_status>open</wp:ping_status>
<wp:post_name>arcgis-server-93-rest-api-first-looks-part-1</wp:post_name>
<wp:status>publish</wp:status>
<wp:post_parent>0</wp:post_parent>
<wp:menu_order>0</wp:menu_order>
<wp:post_type>post</wp:post_type>
<wp:post_password></wp:post_password>
<wp:is_sticky>0</wp:is_sticky>
<wp:postmeta>
<wp:meta_key>_edit_last</wp:meta_key>
<wp:meta_value><![CDATA[3307217]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_edit_lock</wp:meta_key>
<wp:meta_value><![CDATA[1211627483]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_oembed_43d2baebeb5a1d11345e531ed7e9f0f4</wp:meta_key>
<wp:meta_value><![CDATA[{{unknown}}]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_oembed_7be47e26ee69035b27530f0ea2a59e2c</wp:meta_key>
<wp:meta_value><![CDATA[{{unknown}}]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_oembed_7dbd16b04f7b36de1bf8bae4a4424622</wp:meta_key>
<wp:meta_value><![CDATA[{{unknown}}]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_oembed_6e9d6b6c26c54cdb27eaa61ab98340e3</wp:meta_key>
<wp:meta_value><![CDATA[{{unknown}}]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_oembed_def0a2783a01c3660ea30f4131abfd5b</wp:meta_key>
<wp:meta_value><![CDATA[{{unknown}}]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_oembed_118b3fc0c9839d4dd8a3ab732ea5c7b0</wp:meta_key>
<wp:meta_value><![CDATA[{{unknown}}]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_oembed_647b97409601ed96d07727beb98389ab</wp:meta_key>
<wp:meta_value><![CDATA[{{unknown}}]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_oembed_cb3f6d308581431230548ca8955303c4</wp:meta_key>
<wp:meta_value><![CDATA[{{unknown}}]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_oembed_7ca76b730f164e94e96418b66b61913d</wp:meta_key>
<wp:meta_value><![CDATA[{{unknown}}]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_oembed_1eb4d1f2cd0bcadba98e5f032085c8f9</wp:meta_key>
<wp:meta_value><![CDATA[{{unknown}}]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_oembed_dcff3c13835ec13cdce6f463877366c2</wp:meta_key>
<wp:meta_value><![CDATA[{{unknown}}]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_oembed_5d67b769d8962d283381afda08286bb1</wp:meta_key>
<wp:meta_value><![CDATA[{{unknown}}]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_oembed_c6f642fdf6d491cb022b378b2b7c37b8</wp:meta_key>
<wp:meta_value><![CDATA[{{unknown}}]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_oembed_66c9aa288a466a8e5d338ecadf4ed5af</wp:meta_key>
<wp:meta_value><![CDATA[{{unknown}}]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_oembed_bf7332ea86882a27ef1d519aa09de798</wp:meta_key>
<wp:meta_value><![CDATA[{{unknown}}]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_oembed_5b7dc7925540c0f82803ffb952707163</wp:meta_key>
<wp:meta_value><![CDATA[{{unknown}}]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_oembed_e960fc9f7cf848b9be5aecaf7c112621</wp:meta_key>
<wp:meta_value><![CDATA[{{unknown}}]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_oembed_6fd89fa66c6e7d4ab05f6dcc5e98eca7</wp:meta_key>
<wp:meta_value><![CDATA[{{unknown}}]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_oembed_8c9325197286b9017939c6fda5053ee8</wp:meta_key>
<wp:meta_value><![CDATA[{{unknown}}]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_oembed_e103848deeac26eca7120bf9171c6aa8</wp:meta_key>
<wp:meta_value><![CDATA[{{unknown}}]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_oembed_6652deab31b5031016754798ca386e4a</wp:meta_key>
<wp:meta_value><![CDATA[{{unknown}}]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_oembed_14d17a9b053eee15a5445745632b7894</wp:meta_key>
<wp:meta_value><![CDATA[{{unknown}}]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_oembed_99de51c4db13f70f21cf5db2513665aa</wp:meta_key>
<wp:meta_value><![CDATA[{{unknown}}]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_oembed_baeb249d7952e2c0abb6bdac8715e21d</wp:meta_key>
<wp:meta_value><![CDATA[{{unknown}}]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_oembed_8e63789eba120505bd50535c0caf3c8c</wp:meta_key>
<wp:meta_value><![CDATA[{{unknown}}]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_oembed_981aaef016eb2f59fd6e7e590f816a69</wp:meta_key>
<wp:meta_value><![CDATA[{{unknown}}]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_oembed_fb4a00f4ad8f4ced0fad14ec2222493f</wp:meta_key>
<wp:meta_value><![CDATA[{{unknown}}]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_oembed_20b70cd94651c13057fba4b0da6e0383</wp:meta_key>
<wp:meta_value><![CDATA[{{unknown}}]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_oembed_9b40642a7375f87eea8be702e60e63a7</wp:meta_key>
<wp:meta_value><![CDATA[{{unknown}}]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_oembed_7d2734cb165ff4d7a93b5cf9622b2aee</wp:meta_key>
<wp:meta_value><![CDATA[{{unknown}}]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_oembed_c2f1ff43db17594ef446d6cb12b37a3e</wp:meta_key>
<wp:meta_value><![CDATA[{{unknown}}]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_oembed_bc0ab7637c92575bdd8c0cb1376eeb85</wp:meta_key>
<wp:meta_value><![CDATA[{{unknown}}]]></wp:meta_value>
</wp:postmeta>
<wp:comment>
<wp:comment_id>15</wp:comment_id>
<wp:comment_author><![CDATA[Dave]]></wp:comment_author>
<wp:comment_author_email>dave@davebouwman.com</wp:comment_author_email>
<wp:comment_author_url>http://blog.davebouwman.net</wp:comment_author_url>
<wp:comment_author_IP>72.254.39.14</wp:comment_author_IP>
<wp:comment_date>2008-05-14 02:42:00</wp:comment_date>
<wp:comment_date_gmt>2008-05-13 21:42:00</wp:comment_date_gmt>
<wp:comment_content><![CDATA[Asked Jeremy @ GeoJSON, and it's not in 9.3 final, likely in a SP.]]></wp:comment_content>
<wp:comment_approved>1</wp:comment_approved>
<wp:comment_type></wp:comment_type>
<wp:comment_parent>0</wp:comment_parent>
<wp:comment_user_id>0</wp:comment_user_id>
</wp:comment>
<wp:comment>
<wp:comment_id>28</wp:comment_id>
<wp:comment_author><![CDATA[Marcel]]></wp:comment_author>
<wp:comment_author_email>mfrehner@gmx.net</wp:comment_author_email>
<wp:comment_author_url></wp:comment_author_url>
<wp:comment_author_IP>217.64.164.107</wp:comment_author_IP>
<wp:comment_date>2008-05-23 19:06:49</wp:comment_date>
<wp:comment_date_gmt>2008-05-23 14:06:49</wp:comment_date_gmt>
<wp:comment_content><![CDATA[Fascinated by the new REST API, I started exporing the Web, looking for information about RESTful(ness). On Wikipedia I found that one of the principles of REST is to rely on "a constrained set of well-defined operations". If I'm not mistaken these operations are defined by the HTTP protocol an include GET, POST, PUT, HEAD, DELETE, TRACE, OPTIONS an CONNECT. Isn't it contradictory if the AGS REST API defines its own additional operations like identify, find, GenerateKML, ...?]]></wp:comment_content>
<wp:comment_approved>1</wp:comment_approved>
<wp:comment_type></wp:comment_type>
<wp:comment_parent>0</wp:comment_parent>
<wp:comment_user_id>0</wp:comment_user_id>
</wp:comment>
<wp:comment>
<wp:comment_id>29</wp:comment_id>
<wp:comment_author><![CDATA[ruprict]]></wp:comment_author>
<wp:comment_author_email>glenn@goodrichs.net</wp:comment_author_email>
<wp:comment_author_url></wp:comment_author_url>
<wp:comment_author_IP>32.129.67.85</wp:comment_author_IP>
<wp:comment_date>2008-05-24 16:27:31</wp:comment_date>
<wp:comment_date_gmt>2008-05-24 11:27:31</wp:comment_date_gmt>
<wp:comment_content><![CDATA[@Marcel--good question. Really good question.
REST is based on the ideas of Resources (defined by URIs/URLs) and verbs (the HTTP verbs you list) As far as the identify, find, etc operations you mention, I think the proper way to REST-a-fize them would be to make them params to a GET request. The AGS REST api puts identify in the URI which, arguably, is against the REST architectural style. "identify" is an operation, not a resource.
Example AGS REST Identify URI
http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/identify?f=json&amp;geometry[...]
Following "strict" REST, it maybe should be
http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer?op=identify&amp;f=json&amp;geometry[...]
So, you pass the operation to perform (identify) as a parameter to the GET request of the mapservice resource. In other words, I think you have a point.
Having said that, one of the reasons (IMO) that REST is so popular is its inherent flexibility. It makes it easy to use services to get things done, which (again, arguably) SOAP does not. I think both styles have their uses, but REST is much, much easier. In fact, I have a hard time using the words "strict" and "constrained' in the same sentence as REST
I am, however, fully prepared to be wrong about this....
Thanks for the great comment.]]></wp:comment_content>
<wp:comment_approved>1</wp:comment_approved>
<wp:comment_type></wp:comment_type>
<wp:comment_parent>0</wp:comment_parent>
<wp:comment_user_id>3307217</wp:comment_user_id>
</wp:comment>
<wp:comment>
<wp:comment_id>103</wp:comment_id>
<wp:comment_author><![CDATA[Braden]]></wp:comment_author>
<wp:comment_author_email>braden.miller@state.ma.us</wp:comment_author_email>
<wp:comment_author_url></wp:comment_author_url>
<wp:comment_author_IP>146.243.4.157</wp:comment_author_IP>
<wp:comment_date>2009-01-22 00:49:41</wp:comment_date>
<wp:comment_date_gmt>2009-01-21 19:49:41</wp:comment_date_gmt>
<wp:comment_content><![CDATA[Does the REST api provide functionality to view metadata for the spatial layers in a map service, or the ability to view those layers' attribute tables? Are these abilities inherent in ArcServer itself, even?
thanks,
Braden
btw, this all new to me, as I'm sure is evident by my questions, so thanks!]]></wp:comment_content>
<wp:comment_approved>1</wp:comment_approved>
<wp:comment_type></wp:comment_type>
<wp:comment_parent>0</wp:comment_parent>
<wp:comment_user_id>0</wp:comment_user_id>
</wp:comment>
<wp:comment>
<wp:comment_id>104</wp:comment_id>
<wp:comment_author><![CDATA[ruprict]]></wp:comment_author>
<wp:comment_author_email>glenn@goodrichs.net</wp:comment_author_email>
<wp:comment_author_url></wp:comment_author_url>
<wp:comment_author_IP>71.75.234.80</wp:comment_author_IP>
<wp:comment_date>2009-01-22 05:47:47</wp:comment_date>
<wp:comment_date_gmt>2009-01-22 00:47:47</wp:comment_date_gmt>
<wp:comment_content><![CDATA[It really depends on what you mean by metadata. If you mean the FGDC stuff, then no. That is still only handle by the (soon-to-be-dead?) ArcIMS Metadata service, as far as web publishing. However, the REST API does expose a good bit of metadata, which you can see an example of using ESRI's sample servers:
<a href="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Portland/Portland_ESRI_LandBase_AGO/MapServer" rel="nofollow">Map Service</a>
<a href="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Portland/Portland_ESRI_LandBase_AGO/MapServer/3" rel="nofollow">Layer Info</a>
As far as "Open Attribute Table", that doesn't exist as such, but you can query layers and get back features, etc.
Hope that helps,
Glenn
Oh, and this is new to most people, so no worries!]]></wp:comment_content>
<wp:comment_approved>1</wp:comment_approved>
<wp:comment_type></wp:comment_type>
<wp:comment_parent>103</wp:comment_parent>
<wp:comment_user_id>3307217</wp:comment_user_id>
</wp:comment>
</item>
<item>
<title>ArcGIS Server 9.3 First Looks, Part 2: Virtual Earth Adapter</title>
<link>http://ruprict.net/2008/05/29/arcgis-server-93-first-looks-part-2-virtual-earth-adapter/</link>
<pubDate>Thu, 29 May 2008 18:31:08 +0000</pubDate>
<dc:creator><![CDATA[Ruprict]]></dc:creator>
<category domain="tag"><![CDATA[ArcGIS Server]]></category>
<category domain="tag" nicename="arcgis-server"><![CDATA[ArcGIS Server]]></category>
<category domain="tag"><![CDATA[Dojo]]></category>
<category domain="tag" nicename="dojo"><![CDATA[Dojo]]></category>
<category domain="tag"><![CDATA[JSON]]></category>
<category domain="tag" nicename="json"><![CDATA[JSON]]></category>
<category domain="tag"><![CDATA[REST]]></category>
<category domain="tag" nicename="rest"><![CDATA[REST]]></category>
<category><![CDATA[Uncategorized]]></category>
<category domain="category" nicename="uncategorized"><![CDATA[Uncategorized]]></category>
<category domain="tag"><![CDATA[Virtual Earth]]></category>
<category domain="tag" nicename="virtual-earth"><![CDATA[Virtual Earth]]></category>
<guid isPermaLink="false">http://ruprict.wordpress.com/?p=20</guid>
<description></description>
<content:encoded><![CDATA[We are using the <a class="zem_slink" title="Microsoft Virtual Earth" rel="wikipedia" href="http://en.wikipedia.org/wiki/Microsoft_Virtual_Earth" target="_blank">Virtual Earth</a> Tile Server that Dave Bouwman created which publishes tiles from <a class="zem_slink" title="ArcGIS Server" rel="wikipedia" href="http://en.wikipedia.org/wiki/ArcGIS_Server" target="_blank">ArcGIS Server</a> services to Virtual Earth. It is a danged neato peace of software, and combined with the ArcDeveloper REST API, gives us a great option for exposing ArcGIS Server services. In fact, it's such a great option that <a class="zem_slink" title="ESRI" rel="homepage" href="http://www.esri.com/" target="_blank">ESRI</a> has made it a core offering, providing adapters for <a class="zem_slink" title="Google Maps" rel="homepage" href="http://maps.google.com" target="_blank">Google Maps</a> and Virtual Earth along with the new REST API at 9.3. This post focuses on the Virtual Earth adapter, although I am guessing it is not functionally different from the Google Maps adapter.
When I heard about the javascript and REST APIs coming in 9.3, I was very excited. I proclaimed the end of all pain in the GIS nerd world, just knowing that these new offerings would not only make my applications better, but they would make me a better person. They would help me easily query my GIS data and teach my kids right from wrong.
My expectations may have been a bit too high.
Here are some things that I didn't know about the VE Adapter. They may be obvious to some, but I was mildly surprised to hear them:
<ul>
<li>You HAVE to use a tile cache to use the VE adapter. Yes, I know it isn't that surprising, but I had some hope that we could display live services. Yes, I know it would be slow, but sometimes hope blinds a man...</li>
<li>You HAVE to use the WGS84 Web Mercator GCS, which is not a requirement of Dave B's tile server (score one for Dave, open source, and little people everywhere)</li>
<li>The ArcGIS Server REST API supports JSONP out-of-the-box. All you have to do is add a 'callback' parameter to your querystring and it'll return the <a class="zem_slink" title="JSON" rel="wikipedia" href="http://en.wikipedia.org/wiki/JSON" target="_blank">JSON</a> all nicely wrapped in the javascript function you specify. That is very, very nice.</li>
</ul>
You can use the 'cache-on-demand' feature, which is a godsend to those of us who have watched cache generation processes leak into 3 weeks.
So, real quick like, I'll crank out some code that shows you to query the REST API to get all the available map services, add them to your page. Then, just because I am freaking crazy, we'll add the ability to toggle the tile layers on/off on your VE map.
<h3>Setup</h3>
First, get ArcGIS Server 9.3. Then, publish a couple of map services per the requirements of using the VE adapter. I mention most of it above, but <a href="http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/ve/help/Working%20with%20ArcGIS%20Server%20services/CreatingServices.htm" target="_blank">here it is from the horse's mouth</a>. Oh, and it'll help if the map services have data from the same area.
<h3>Make a VE Map</h3>
Create an HTML file (doesn't even have to be served by a web server, since we're all in javascript) and put in the base structure for a map. Something like:
[sourcecode language='html']
<html>
<head>
<!-- Virtual Earth API -->
<script src="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6" type="text/javascript"></script>
<!-- ESRI VE ADapter -->
<script src="http://serverapi.arcgisonline.com/jsapi/ve/?v=1" type="text/javascript"><!--mce:1--></script>
<!-- DOJO from AOL CDN -->
<script type="text/javascript" src="http://o.aolcdn.com/dojo/1.1.1/dojo/dojo.xd.js"></script>
<script language="javascript" type="text/javascript" >
var map = null;
var layerFactory;
function OnPageLoad() {
var centerat = new VELatLong(45.5852, -122.5951); //Replace this with your center
map = new VEMap('mymap');
map.LoadMap(centerat,12,VEMapStyle.Aerial ,false);
layerFactory= new ESRI.ArcGIS.VE.ArcGISLayerFactory();
}
dojo.addOnLoad(OnPageLoad);
</script>
<body>
<div id='mymap' style="position:relative;height:400px;width:600px;float:left;"></div>
<ul id="services"></ul></body>
</html>
[/sourcecode]
So, a couple of quick comments about this "base" VE map. I have added the script tags to pull in the ESRI VE adapter, as well as Dojo. I am gonna use Dojo for this example because it makes querying a cross-domain REST service easy as 1,2,3. It is likely that your AGS installation will not be on the same server or in the same domain as your web server, so it is nice that AGS 9.3 has JSONP baked right in. Also, in the above code, I create a ESRI layer factory, which is an object that creates tile specifications for Virtual Earth. Finally, I add an unordered list (ul) that will eventually hold my services.
Ideally, we'd like to boogie out and get the list of services that are currently being published by AGS when the page loads. So, lets add a getServices() method and call it from our OnPageLoad...shall we?
[sourcecode language='jscript']
var AGS_SERVER="http://yourserver/arcgis/rest/services";
function getServices(){
dojo.io.script.get({
url:AGS_SERVER,
content:{
f:'json'
},
load:function(resp){
services=resp.services; // Automatically deserialized by dojo. Thanks!
var ulServ=dojo.byId('services');
dojo.forEach(services,function(s){
if (s.type=="MapServer"){
var li = document.createElement("ul");
li.innerHTML=s.name;
ulServ.appendChild(li);
dojo.connect(li,"onclick",dojo.hitch(li,serviceClick));
}
}
);
},
callbackParamName:'callback'
});
}
[/sourcecode]
Here is where using Dojo (or any javascript framework that will handle JSONP requests easily) really pays off. The getServices method is simply issuing an AJAX request to our AGS REST Service Catalog. The response is automatically deserialized into JSON and fed to our 'load' function. The load function then loops over each service (the response has folders in it too, but we are ignoring those today) and adds a list item to our services list for each MapServer. A click handler is added to each list item to call our serviceClick function (we haven't added that yet). Side note: Using dojo.hitch here forces the serviceClick method to be called in the context of the list item that is clicked. In other words, when serviceClick is called, the 'this' keyword will refer to the list item. A whole lotta stuff happening on one line of code, which is one place where I think Dojo shines.
So, let's quickly add the serviceClick (and some other) function:
[sourcecode language='jscript']
function serviceClick(){
var lyr= map.GetTileLayerByID(this.innerHTML);
if (lyr==null)
{
addLayer(this.innerHTML);
}
else
{
toggleLayer(this.innerHTML);
}
}
function addLayer(lyrName){
layerFactory.CreateLayer(AGS_SERVER+"/"+lyrName+"/MapServer", lyrName,GetMap);
}
function toggleLayer(lyrName){
var lyr=map.GetTileLayerByID(lyrName);
if (lyr.IsVisible)
map.HideTileLayer(lyrName);
else
map.ShowTileLayer(lyrName);
}
function GetMap(tileSourceSpec, resourceInfo) {
map.AddTileLayer(tileSourceSpec,true);
}
[/sourcecode]
So, the serviceClick function gets the innerHTML from the list item clicked, which in this case is the name of the AGS service. It then checks our Virtual Earth map to see if that layer has been added. If the layer has not been added, we use the layer factory created on page load to create a tile specification for that service. The layer factory actually issues an AJAX request, which is why we have to specify a callback method (GetMap). GetMap adds the created tile spec to the map, and our layer is visible. Clicking on the service name in the list again will toggle that layer off. So, with very little code, we've created a pretty functional map with a nice VE interface and a poor man's table-of-contents. Not bad for a few minutes work.
As usual, this post has gone on longer than I'd hoped.  If you want the not-split-up-by-the-blog-post HTML file, just drop me a comment.  Also, drop a comment if you have a question or think I am wrong/high/crazy.
<div class="zemanta-pixie" style="width:100%;margin:5px 0;"><a class="zemanta-pixie-a" title="Zemified by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" style="border:medium none;float:right;" src="http://img.zemanta.com/pixie.png?x-id=0354114a-815a-497c-bbd8-e77ff64f18fd" alt="" /></a></div>]]></content:encoded>
<excerpt:encoded><![CDATA[]]></excerpt:encoded>
<wp:post_id>20</wp:post_id>
<wp:post_date>2008-05-29 23:31:08</wp:post_date>
<wp:post_date_gmt>2008-05-29 18:31:08</wp:post_date_gmt>
<wp:comment_status>open</wp:comment_status>
<wp:ping_status>open</wp:ping_status>
<wp:post_name>arcgis-server-93-first-looks-part-2-virtual-earth-adapter</wp:post_name>
<wp:status>publish</wp:status>
<wp:post_parent>0</wp:post_parent>
<wp:menu_order>0</wp:menu_order>
<wp:post_type>post</wp:post_type>
<wp:post_password></wp:post_password>
<wp:is_sticky>0</wp:is_sticky>
<wp:postmeta>
<wp:meta_key>_edit_last</wp:meta_key>
<wp:meta_value><![CDATA[3307217]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_edit_lock</wp:meta_key>
<wp:meta_value><![CDATA[1221065566]]></wp:meta_value>
</wp:postmeta>
<wp:comment>
<wp:comment_id>59</wp:comment_id>
<wp:comment_author><![CDATA[Robert McLaurine]]></wp:comment_author>
<wp:comment_author_email>rmclaurine@geo-jobe.com</wp:comment_author_email>
<wp:comment_author_url></wp:comment_author_url>
<wp:comment_author_IP>207.65.194.59</wp:comment_author_IP>
<wp:comment_date>2008-09-12 19:42:00</wp:comment_date>
<wp:comment_date_gmt>2008-09-12 14:42:00</wp:comment_date_gmt>
<wp:comment_content><![CDATA[Just curious. I had seen some third party solutions in 9.2 that allowed overlaying and toggling(?) gis layers on virtual earth. Is the difference in how the tiles are cached or how 9.3 serves them. I had just seen the requirement for a single layer fused cache when working with arcgis.]]></wp:comment_content>
<wp:comment_approved>1</wp:comment_approved>
<wp:comment_type></wp:comment_type>
<wp:comment_parent>0</wp:comment_parent>
<wp:comment_user_id>0</wp:comment_user_id>
</wp:comment>
<wp:comment>
<wp:comment_id>34</wp:comment_id>
<wp:comment_author><![CDATA[Webdesign]]></wp:comment_author>
<wp:comment_author_email>roosevelt.anima@googlemail.com</wp:comment_author_email>
<wp:comment_author_url>http://ooyes.net</wp:comment_author_url>
<wp:comment_author_IP>88.191.80.227</wp:comment_author_IP>
<wp:comment_date>2008-06-02 21:27:28</wp:comment_date>
<wp:comment_date_gmt>2008-06-02 16:27:28</wp:comment_date_gmt>
<wp:comment_content><![CDATA[Great thinking]]></wp:comment_content>
<wp:comment_approved>1</wp:comment_approved>
<wp:comment_type></wp:comment_type>
<wp:comment_parent>0</wp:comment_parent>
<wp:comment_user_id>0</wp:comment_user_id>
</wp:comment>
<wp:comment>
<wp:comment_id>57</wp:comment_id>
<wp:comment_author><![CDATA[Robert McLaurine]]></wp:comment_author>
<wp:comment_author_email>rmclaurine@geo-jobe.com</wp:comment_author_email>
<wp:comment_author_url></wp:comment_author_url>
<wp:comment_author_IP>207.65.194.59</wp:comment_author_IP>
<wp:comment_date>2008-09-10 21:50:55</wp:comment_date>
<wp:comment_date_gmt>2008-09-10 16:50:55</wp:comment_date_gmt>
<