%% %% MagicPoint Presentation Of the Gimp %% Copyright © 1999 Tuomas Kuosmanen %% This is a test. All rights reserved :) %% %% %% Font definitions, modify to suit your system. %% (Humanist comes with the CD version of Linux WordPerfect 8 btw) %% %% %deffont "standard" tfont "fonts/arialn.ttf" %deffont "header" tfont "fonts/ariblk.ttf" %deffont "typewriter" tfont "fonts/courier.ttf" %deffont "quote" tfont "fonts/ozhand.ttf" %% %% %% Style definitions for the page template - based on line numbers %% %% # TOP GAP # %default 1 size 1, vgap 30 %% # Main Title # %default 2 left, size 5, vgap 60, hgap 40, prefix " ", fore "white", font "header" %% # Subtitle, will fly from left # %%default 3 right, size 4, vgap 10, lcutin, font "standard" %% # The horizontal bar # %default 3 left, size 6, bar "#34575b", vgap 60 %% First line of content %default 4 size 5, fore "white", vgap 50, hgap 18, prefix " ", font "standard" %% %% Default settings that are applied to TAB-indented lines. %% %tab 1 size 5, prefix " ", icon delta3 "#a9a78b" 40 %tab li size 5, prefix " ", icon delta3 "black" 40 %tab 2 size 4, prefix " ", icon delta3 "#a9a78b" 40 %tab 3 size 3, prefix " ", icon delta3 "#a9a78b" 40 %% %% nice background gradient %% %%default 1 bgrad 0 0 64 32 1 "black" "black" "#34585b" %default 1 bimage "pics/bgtilefade.jpeg" 640x480 %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% The first page - a cartoonish title :) %% %page %nodefault %%center, size 7, font "header", fore "#34585b" %center, size 18, tfont "fonts/topspeed.TTF", fore "white" %bimage "pics/bgtile.jpeg" 640x480 An introduction to xml-rpc %%xml-rpc %size 3, center, rcutin, fore "#34585b", center by %size 8, center, lcutin, fore "#54787b", center Adrian Likins %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page What is xml-rpc A simple http based RPC protocol that happens to use XML as the encoding method. %pause Emphasis on simple and RPC. %pause For 99% of useage, the xml is transparent. %pause RPC is Remote Procedure Call %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page 60,000 Feet XML-RPC is a simple, relaitvely lightweight mechanism for sending information to another server about which and with what you want to run some function, and then getting the results back in a constitent format. It does this via well known standards, and as simply as possible. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page A Metaphor, for those that dont get it Think of it as a standarized way of talking to a web app. Like running a CGI, but with a well understood input, and output format that is easy to parse. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Thats it? %pause Yes, mostly. I said simple right? %pause Simple enough to actually be really useful %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page How it works (client->server) Application level usage Client and server libaray API's The encoding of the RPC The transport of the RPC the unencoding of the RPC %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page The Parts (server->client) The running of the RPC The Encoding of the results The transport of the results the unencoding of the results Library Layer Application Layer %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page App And libs Application level usage heavily dependent on the libary used Library Layer Varies greatly from language to language, \ and even implmentation to implementation. XML-RPC is _NOT_ an API specification. It is a protocol specification. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page The Encoding of the RPC Dont worry about the XML part. Forget it exists. The spec allows you to encode: methodName params Params are arguments to the function call. They can be of types: int boolean string double dateTime.iso8601 arbitrary blob of stuff %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page More data types Can I do structs? Yes Any of the above data types can be used for values \ in either structs or arrays. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Structs each element in a struct has a name and value Generally maps to hashes/dictionays/associative arrays \ in languages %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Arrays Arrays are lists of values. The values can be \ different types, but have no names associated with them. Generally maps to list or arrays %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page XML If you must know how XML fits in... All of the above types are encoded as various bits \ of XML See the XML-RPC spec for details. But you really dont need to know that. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Transport Now that you have this blob of data, how do you get it to the \ other machine? For xml-rpc, the transport is HTTP or HTTPS In particular, http POST request to the server. The response is a standard http response, with \ mime type of text/xml %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Unencoding The server now has the information (method name, and params) The server side unencodes it into a method name, a set of params. Then it invokes this method. Ie, demarshalling. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page The Response Server gets results of method invocation, now it has to send \ it back to the server. It will then encode these, and returns them as part of the \ http response body. %pause NOTE: This is done as the response to the intial request, \ not as a seperate http request. This is important. More \ important that that xml bit you wont stop thinking about. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Client receives repsonse Client receives the response, unencodes it, returns it to \ the library/app level. The app does whatever it wants. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Availability XML-RPC implementations are available for: python perl c c++ php java tcl asp com applescript dylan/ common lisp / rebol other languages no one users %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page What do you use it for? As a method to allow two or more processes on \ seperate machines to communicate via the network. Those cases where you think "I really need to ask \ that machine something, and use it on this machine" are \ probabaly good canidates for XML-RPC. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Who uses it? The Red Hat Network uses xml-rpc extensively, including: up2date rhn_register rhn_check We also use it internally to facilitate communications \ RHN apps written in python, and web apps written in perl. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Why? %pause It's easy. %pause It's cross platform. %pause It's cross language. %pause It's network oriented. %pause It's relatively lightweight. %pause It's easy. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page What it isnt low latency A bulk data transport Asyncrounous Complicated and sophisticated Writing and xml-rpc implementation is probabaly \ easier than just using CORBA %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Case Study The Red Hat Updater rpm grpm up2date v1 rpmfind/gnorpm up2date v2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Example #/usr/bin/python import os,sys import xmlrpclib from xmlrpclib import * server = Server('http://192.68.0.1/RPC2') print server.mp3.playlist() %pause Ingo Molnar is still smarter than you %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Simple Remember, I told you it was simple. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Server code example %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Soap Soap is the result of Microsoft and IBM looking at xml-rpc and saying, "thats a good idea, but it needs a few things." Core technology of .NET Which is really annoyinig, because it is actually a pretty nice protocol. SOAP is more complicated than XML-RPC, but less than CORBA %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page XML Protocol XML Protocol is the result of the W3C looking at SOAP and \ saying "thats a good idea, but it needs a few things." Even more complicated. High "standards" bloat. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Other RPC protocols Why to not use SOAP/CORBA/DCE RPC/RMI/etc Because they are complicated and I r dum The Primary advantage of XML-RPC is it's simplicity It's so simple and stupid, it's actually pretty useful. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page URLS http://www.xml-rpc.com %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%