The Artima Developer Community
Sponsored Link

Python Buzz Forum
XML-RPC, and a proof of concept that misuses the XML-Data serialization format to help parse...

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Phillip Pearson

Posts: 1083
Nickname: myelin
Registered: Aug, 2003

Phillip Pearson is a Python hacker from New Zealand
XML-RPC, and a proof of concept that misuses the XML-Data serialization format to help parse... Posted: May 25, 2006 2:55 AM
Reply to this message Reply

This post originated from an RSS feed registered with Python Buzz by Phillip Pearson.
Original Post: XML-RPC, and a proof of concept that misuses the XML-Data serialization format to help parse...
Feed Title: Second p0st
Feed URL: http://www.myelin.co.nz/post/rss.xml
Feed Description: Tech notes and web hackery from the guy that brought you bzero, Python Community Server, the Blogging Ecosystem and the Internet Topic Exchange
Latest Python Buzz Posts
Latest Python Buzz Posts by Phillip Pearson
Latest Posts From Second p0st

Advertisement

Nice to see XML-RPC is still in active use. The buzz these days is all about REST, but XML-RPC is still the easiest way to make widely-accessible web services (IMHO).

BTW, after talking this morning to Leonard Richardson about web services using REST and XML-RPC APIs, I implemented last month's XML-RPC idea - using the XML-RPC ("XML-Data"?) serialization format to encode the data returned by a REST API - in the PeopleAggregator API code, so now we have four ways of accessing the API:

- normal XML-RPC

- REST ("low church REST" - i.e. GET and POST HTTP methods, so you can debug the API in a browser) with a choice of output format:

-- XML (<response><success>true</success>...</response>)

-- JSON ({'success': true, ...})

-- XML-RPC's XML-Data (<methodResponse>...</methodResponse>)

I implemented it by getting xmlrpc.php to check the request method and input content type, and pass GET requests and POSTs with x-www-form-urlencoded content type through to the REST logic, leaving everything else to be handled by the IXR XML-RPC library.

- - -

Leonard and I were throwing around some ideas about standardising REST APIs, or making some sort of a descriptor language for them -- in Leonard's words, "making them all work the same, or parameterizing the axes on which they differ".

Here's something that occurred to me later: instead of describing XML with WSDL or some equivalent, you could write XSLT that would turn the XML output from a REST API into XML-Data, which could then be parsed down into a convenient data structure.

I don't expect that people will like it, because it combines technologies from warring communities - the minimalists will complain about the XSLT, the XML/RDF types won't like the use of XML-Data, and so on - but you have to admit: XSLT and XML-Data are the perfect tools to map between arbitrary XML formats and common data structures (arrays, structs, integers, strings and floats).

Update: To show that this method WORKS, and perhaps to act as a starting point for anyone who takes this seriously, I've made a proof of concept XSL transform that converts selected XML responses from Flickr into sensible XML-RPC responses. Download here:

    → rest-via-xmlrpc.zip

(BTW - Danny Ayers' excellent XSLT example and Norm Walsh's great tutorial were very helpful here - this is my first time using XSLT.)

Comment

Read: XML-RPC, and a proof of concept that misuses the XML-Data serialization format to help parse...

Topic: links for 2006-05-23 Previous Topic   Next Topic Topic: links for 2006-05-13

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use