[mapguide-internals] MapGuide RESTful Web Service

Jason Birch Jason.Birch at nanaimo.ca
Wed Sep 5 13:25:03 EDT 2007


It strikes me that REST would be a great addition to repository (not
just session) management too.  All of the resources are accessible by
pseudo-URL already (Library://).  I'm not sure how you would deal with
things like resource data / config documents though...

Imagine going to http://localhost/rest/library and getting:

<ul>
<li><a href="TestData" class="Folder">TestData</a></li>
<li><a href="Nanaimo" class="Folder">Nanaimo</a></li>
<li><a href="Samples" class="Folder">Samples</a></li>
<li><a href="RasterTest.FeatureSource"
class="FeatureSource">RasterTest</a></li>
<li><a href="RasterTest.LayerDefinition"
class="LayerDefinition">RasterTest</a></li>
</ul>

Or going to http://localhost/rest/library.js and getting

{ features: [
   { "type": "Folder", name="TestData",
uri="http://localhost/rest/library/TestData" },
   { "type": "Folder", name="Nanaimo",
uri="http://localhost/rest/library/Nanaimo" },
   { "type": "Folder", name="Samples",
uri="http://localhost/rest/library/Samples" },
   { "type": "FeatureSource", name="RasterTest",
uri="http://localhost/rest/library/RasterTest.FeatureSource" },  
   { "type": "LayerDefinition", name="RasterTest",
uri="http://localhost/rest/library/RasterTest.LayerDefinition" }
  ]
}

Or going to http://localhost/rest/library.xml and getting the default
EnumerateResources output.

The beauty of this is that not only could the directory listings be
returned in multiple representations, but so could the actual resources.
The JSON work with the MapAgent is defining some standard XML-to-JSON
mapping that could be used for JSON representations of the XML
resources.  I don't think it's worth reformatting the output to be more
JSON-like, as the effort required to manage two semantically different
representations would be excessive.

Jason

-----Original Message-----
From: Haris Kurtagic
Subject: [mapguide-internals] MapGuide RESTful Web Service

My colleague Simon Pelicon and I are working on adding a Web Service
functionality to Map Guide Open Source.

We are trying to implement it as RESTful Web Service.


More information about the mapguide-internals mailing list