chickadee » xml-rpc » xml-rpc-call->xml-rpc-response

xml-rpc-call->xml-rpc-response call-sxml proceduresprocedure

This procedure converts an XML-RPC procedure call described by call-sxml into an SXML representation of the result. The procedure is looked up in procedures, invoked, and its return values are converted into the appropriate SXML structure describing a methodResponse. If an error occurs inside the procedure, the procedure does not exist, or the XML is invalid, a methodResponse encoding the fault is constructed instead.

(use xml-rpc-server)

(xml-rpc-call->xml-rpc-response
  `(*TOP*
     (*PI* xml "version=\"1.0\"")
     (methodCall  ; (xml-rpc-methodcall 'scheme.makeList '(1 2 3))
       (methodName "scheme.makeList")
         (params
           (param (value (int "1")))
           (param (value (int "2")))
           (param (value (int "3"))))))
  `((scheme.makeList . ,list)))
 =>
(methodResponse
  (params
    (param (value
             (array
	       (data
	         (value (i4 "1"))
                 (value (i4 "2"))
                 (value (i4 "3"))))))))