[mapguide-internals] MapGuide RESTful Web Service

Haris Kurtagic haris at sl-king.com
Wed Sep 5 08:11:29 EDT 2007


Yes you are right as I wrote in a frist email MapGuide is already kind
of Web Service which is in REST world called REST-RPC hybrid.
It is in a sense RPC that it is exposing API trough Http URI.
RESTfull service would be resource oriented with also several main
differences like Statelessness, Http methods etc.
Also support for other formats would be included and also there is some
missing functionality .
With REST editing is also supported.

Haris

-----Original Message-----
From: mapguide-internals-bounces at lists.osgeo.org
[mailto:mapguide-internals-bounces at lists.osgeo.org] On Behalf Of
Kenneth, GEOGRAF A/S
Sent: Wednesday, September 05, 2007 1:33 PM
To: MapGuide Internals Mail List
Subject: Re: [mapguide-internals] MapGuide RESTful Web Service

So, if I request a layerdefinition, I get the xml from the 
layerdefinition in the repository?

Does that mean the following two will return the same xml file:
http://localhost/mapguide/mapagent/mapagent.fcgi?OPERATION=GETRESOURCECO
NTENT&RESOURCEID=Library://test.LayerDefinition&SESSION=123
http://localhost/mapguide/REST/123/test.LayerDefinition

Is that correctly understood?

So the work you are doing, is exposing functionality from the current 
API as function URLs, without defining the actual objects.
Well, that might prove to be a whole lot faster to implement, since you 
move the workload from implementation to documentation.

Still, a nice leap forward from the current state of using the version 
specific dll's.

Regards, Kenneth, GEOGRAF A/S



Haris Kurtagic skrev:
> Not sure if I understand question correctly, anyhow Map Guide REST is
> exposing data to a client in with XML or JSON there is no need 
> for SOAP "stuff" ( WSDL, WS..).
> As most of data is in XML already in MapGuide that part was quite
> straightforward.
> For now I am concentrating on exposing data which is needed to run a
> viewer and on task's which are performed by the viewer.
>
> Haris
>
> -----Original Message-----
> From: mapguide-internals-bounces at lists.osgeo.org
> [mailto:mapguide-internals-bounces at lists.osgeo.org] On Behalf Of
> Kenneth, GEOGRAF A/S
> Sent: Wednesday, September 05, 2007 12:45 PM
> To: MapGuide Internals Mail List
> Subject: Re: [mapguide-internals] MapGuide RESTful Web Service
>
> Very nice indeed.
> I am unfamiliar with REST, but the idea of exposing the server as a 
> webservice is much appreciated.
> Currently I have been using the HTTP tier to achieve this, but it is 
> missing functionality.
>
> I have considered something like this before, but there is a huge pile

> of work in implementing definitions for the datastructures (ea. map 
> definition, runtime map, layerdefinition, etc.).
> How do you adress that issue?
>
>
>
> Regards, Kenneth, GEOGRAF A/S
>
>
>
> Haris Kurtagic skrev:
>   
>> 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
>>   
>>     
> _______________________________________________
> mapguide-internals mailing list
> mapguide-internals at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-internals
> _______________________________________________
> mapguide-internals mailing list
> mapguide-internals at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-internals
>   
_______________________________________________
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