Vishful thinking…

REST in the mainstream

Posted in Uncategorized by viswaug on September 25, 2007

In my last post I talked about REST services in GIS. If you are interested in digging deeper into REST, a whole bunch of information can be found here. But who is using REST data services out there? Well, both the two big software giants are. Both Google and Microsoft are offering their own style of REST protocols for accessing databases over HTTP. Google is offering Google Base and Microsoft is working on Astoria. Being a Microsoft guy, I have been playing around with Astoria and am excited about its possibilities. Microsoft is still actively working on Astoria and are currently inviting insight into its URL syntax style and security. Dare Obasanjo has a great blog post comparing the above two technologies.

Just to demonstrate the fact that you are actually using REST to access data from a database, click here to retreive data from a database using an Astoria REST service in XML format

http://astoria.sandbox.live.com/northwind/northwind.rse/Customers

Adding the ‘format’ query parameter to the URL retrieves the data in JSON format like shown below.

http://astoria.sandbox.live.com/northwind/northwind.rse/Customers?$format=json

Clicking on the above link will let you download the data seen previously in XML format in JSON format. If you want to view the downloaded JSON data, I would recommend using the JSONViewer.

Here is a real simple web page (just HTML and JavaScript) I created that talks to the Microsoft Astoria REST data service and retrieves data from a database in JSON format and the presentation of the data is almost the only thing handled in the web page. This kind of drives towards the separation of concerns strategy too which is great.

2 Responses

Subscribe to comments with RSS.

  1. Steve said, on September 26, 2007 at 3:34 am

    Hey, this JSON stuff is really cool and I have no problem consuming it from the webservice but I’m after how to create the web service to spit out the JSON string. Currently my JSON string gets wrapped up in XML. Do you have any insight on this and can we chat about it?

    Thanks.

  2. viswaug said, on September 26, 2007 at 5:19 am

    Hi Steve,

    Microsoft’s Astoria will enable you to create the web service to spit out the JSON string. If you are not using Astoria yet like me then you can consider enabling your business objects to be converted to JSON. The JayRock framework will enable you to do that. I will send you an email if you want to chat about it some more.

    Thank You,
    Vish


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: