2 REQUIRES: contrib/http-client contrib/calendar ;
3 USING: kernel hashtables xml-rpc xml calendar sequences
4 arrays math httpd io http-client namespaces ;
10 { "divide" [ / ] } } ;
12 : apply-function ( name args -- {number} )
13 [ functions hash ] dip first2 rot call 1array ;
15 : problem>solution ( xml-doc -- xml-doc )
16 receive-rpc dup rpc-method-name swap rpc-method-params
17 apply-function <rpc-response> send-rpc ;
19 : respond-rpc-arith ( -- )
21 string>xml problem>solution xml>string
25 "add" { 1 2 } <rpc-method> send-rpc
26 "http://localhost:8080/responder/rpc/"