Changeset 15232 in project


Ignore:
Timestamp:
07/17/09 19:01:15 (10 years ago)
Author:
sjamaan
Message:

Move the client example up a bit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/4/xml-rpc

    r15227 r15232  
    4444this, because there is some ambiguity in how lists are mapped (either
    4545to arrays or to structs).
     46
     47Here is an example that fetches the current time of day from xml-rpc.org:
     48
     49<enscript highlight=scheme>
     50(require-extension xml-rpc-client)
     51
     52(define time-server
     53  (xml-rpc-server "http://xml-rpc.org/RPC2") )
     54 
     55(define get-current-time
     56  (time-server "currentTime.getCurrentTime") )
     57 
     58(print (time->string (get-current-time)))
     59</enscript>
     60
    4661
    4762For lower-level access to the client (implementing custom handlers,
     
    334349=== Examples
    335350
    336 Fetch time from xml-rpc.org:
    337 
    338 <enscript highlight=scheme>
    339 (require-extension xml-rpc-client)
    340 
    341 (define time-server
    342   (xml-rpc-server "http://xml-rpc.org/RPC2") )
    343  
    344 (define get-current-time
    345   (time-server "currentTime.getCurrentTime") )
    346  
    347 (print (time->string (get-current-time)))
    348 </enscript>
    349 
    350351A simple "hello" server: (this does not currently function and will be changed)
    351352
Note: See TracChangeset for help on using the changeset viewer.