[mapguide-internals] MapGuide RESTful Web Service

Haris Kurtagic haris at sl-king.com
Wed Sep 5 06:45:30 EDT 2007


Yes, Session will use POST and username/password.
Also I am overriding all Http methods so you can set method in a uri
query as well as callbak for JSONP.

I am trying to use existing handlers and functions as much as possible
but I have to made some changes to try to be RESTfull as much as
possible.
Things like current map position and selection and the way it is handled
I changed little bit (more similar to what GetMapImage is doing).

Also I am adding resources for a "Task" itself , so you will be able to
create session/open weblayout/open map in a one RESTfull Task.

Even changing some things I am doing in a such way that you can use all
existing functionallity trought this extension, so existing MapGuide
Viewer and Fusion will work without any changes.

Friends at Amazon UK :) ( I got it two days ago )

Haris

-----Original Message-----
From: mapguide-internals-bounces at lists.osgeo.org
[mailto:mapguide-internals-bounces at lists.osgeo.org] On Behalf Of Jason
Birch
Sent: Wednesday, September 05, 2007 12:24 PM
To: MapGuide Internals Mail List
Subject: RE: [mapguide-internals] MapGuide RESTful Web Service

Wow Haris....
 
That's enough to make my head spin, even if it wasn't 3am here.
 
Really cool idea; I'll be very interested to see the implementation, and
full list of operations/parameters that it supports.  I'm assuming you'd
have a simple POST with userid/password as values to get back a valid
sessionID url?
 
If this was brought into the core development, I could see some real
benefits to Fusion as well.  REST rocks, and this really complements the
recent JSON enhancements to the MapAgent. 
 
I don't know how you managed to get your Ruby book before me.  Mine was
back-ordered for two months and just shipped yesterday. :(
 
Jason

________________________________

From: mapguide-internals-bounces at lists.osgeo.org on behalf of Haris
Kurtagic
Sent: Wed 2007-09-05 3:00 AM
To: MapGuide Internals Mail List
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.

We have a working prototype which I will publish in a couple days.



I would appreciate any comments and suggestions.



Current implementation of  MapGude WebTier is something which is most
similar  to REST-RPC hybrid ( from Leonard Richardson & Sum Ruby book on
RESTfule Web Services).

I want to create a RESTful web service which would follow rules like:
Addressability, Statelessness and Connectedness.



For example working with session MAP is like:



 1. URI for get data about MAP

 HttpMethod: GET URI: BASEURI/REST/SESSION[Id]/MAP[Id]



 2. URI creating new MAP in Session

 HttpMethod: POST URI: BASEURI/REST/SESSION[Id]/MAP ? MapDefName={Map
Definition Name}



3. Get Image ( return png )

 HttpMethod: GET URI:
BASEURI/REST/SESSION[Id]/MAP[Id]/Image.Png[...ImageCreationParameters...
] {.jpg }



4. Get Image Extent ??

 HttpMethod: GET URI: BASEURI/REST/SESSION[Id]/MAP[Id]/Extent



 5. Set Image Extent  ??

 HttpMethod: PUT URI: BASEURI/REST/SESSION[Id]/MAP[Id]/Extent ?
{SETCETNTERX=..}&{SETCENTERY=..}&..  



Also there are URI defined for WebLayout and Session.

Service is supporting response as JSON, XML and JSONP.



Implementation:



I have implemented new ISAPI extension for handling request.

Request which are not handled trough RETS are implemented with standard
HTTP handlers so all previous request  are served normally as well

What it means that also standard viewer is working trough this
extension.



Installation is quite simple just copy files and change in IIS request
.fcgi to .* to new extension.



Simon is working on a viewer which is using just REST request.

This viewer doesn't need web tier ( php, jsp, asp) to run and it even
doesn't need to be run from web server.

You can open viewer html  in browser from desktop and use any MapGuide
Site.



We have working prototype which will release in a 2-3 days so you will
be able to try it.



Very long email from me, but topic is quite large.

I would appreciate if you would share your thoughts on  this topic.



Thanks,

Haris



_______________________________________________
mapguide-internals mailing list
mapguide-internals at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-internals




More information about the mapguide-internals mailing list