qexo-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qexo-general] Qexo as xml-rpc server


From: Terje Pedersen
Subject: [Qexo-general] Qexo as xml-rpc server
Date: Mon, 21 Jul 2003 15:39:40 +0200
User-agent: KMail/1.5.1

Since xml-rpc is all about sending and receiving xml I thought that Qexo 
should be well suited for this task.

Simple example of a xml-rpc service:

define function rpc-response($s){
    element methodRespone {
           element params {
               element param {
                      element value { element string {$s} }
         } } }
}

let $rpc := request-body()/methodCall
return (
unescaped-data("<?xml version='1.0'?>"),
rpc-response("Hello World!")

All that is needed to get this working I think is to implement the 
request-body() method which returns the body part of the posted message using 
either getReader or getInputStream of HttpServletRequest connected to the xml 
parser generating the needed TreeList object I think. (Yes I have dropped the 
checking of methodName here in this simple example)

What about doing client xml-rpc in Qexo: 

define namespace rpc = "rpc:http://time.xmlrpc.com/RPC2";
let $response := rpc:currentTime.getCurrentTime()

Is it possible to have these two lines making a call to lets say rpc-execute() 
generate the methodCall xml from function name and the type and values of the 
arguments?

Ofcourse the simplest solution would be to generate the methodCall xml like I 
did with methodResponse and call lets say rpc-execute()

let $response := rpc-execute("http://time.xmlrpc.com/RPC",$methodcall) 

Finally a comment to you Per, there's a lot of xquery features needed to be 
implemented before extending Qexo with some of my ideas but I'm just 
interessting to hear what other developers think about them and perhaps some 
hints so that I eventually can implement them myself if I decide to. 

Terje Pedersen - address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]