nextwebgen.com

The Next Generation Web Now

@tomic XML-RPC JavaScript Client

Filed under: Web 2.0 News — Dion Almaer at 7:29 am on Tuesday, July 31, 2007

Jon Brisbin has created an XML-RPC JavaScript client called @tomic:

The @tomic XML-RPC client requires ExtJS 1.1, but has no other external requirements. It’s designed to be easy-to-use, flexible, and robust enough for anything you might throw at it. Since this is an initial release, I’m putting it out as a beta (under the GPL).

JAVASCRIPT:

  1.  
  2. Ext.onReady( function()
  3. {
  4.     var xmlrpc = new Atomic.util.XMLRPC( {
  5.         url: “xmlrpc.php”,
  6.         method: “blogger.getUsersBlogs”
  7.     } );
  8.     // Add parameters to the RPC call
  9.     xmlrpc.addParameter( “0123456789ABCDEF” );
  10.     xmlrpc.addParameter( “MyUsername” );
  11.     xmlrpc.addParameter( “mypassword” );
  12.  
  13.     // Subscribe to events
  14.     xmlrpc.addListener( “success”, function( xhr, xml ) {
  15.         // Handle the response from the XML-RPC service, which is in the ‘xml’ object
  16.         console.log( xml );
  17.     } );
  18.     xmlrpc.addListener( “fault”, function( xhr, fault ) {
  19.         // Handle any faults issued by the XML-RPC server
  20.         Ext.MessageBox.alert( “XML-RPC fault #” + fault.code, fault.message );
  21.     } );
  22.  
  23.     // make the call
  24.     xmlrpc.call( {
  25.         method: “blogger.getUsersBlogs”,
  26.         params: [
  27.              “0123456789ABCDEF”,
  28.              “MyUsername”,
  29.              “mypassword”
  30.         ]
  31.     } );
  32. }
  33.  
Share and Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages.
  • blogmarks
  • del.icio.us
  • De.lirio.us
  • digg
  • NewsVine
  • YahooMyWeb

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>