Hi all ,
I am trying to understand XML-RPC and extension writing using python. The problem I am having seems to be dekiwiki config centric.
I have registered a service using the following manifest
<extension>
<title>Calendar</title>
<function>
<name>gethari</name>
<uri>http://67.207.145.173:8888</uri>
<description>Test </description>
<param name="year" type="num" optional="false">The year </param>
<param name="month" type="num" optional="false"> The month</param>
<return type="str" />
</function>
</extension>
The code for that service is in python
import SimpleXMLRPCServer
from SimpleXMLRPCServer import SimpleXMLRPCRequestHandler,SimpleXMLRPCRequestHand ler
#The server function
def gethari(year, month):
# this sends stuff to stdout for troubleshooting purposes
print year
print month
# The return stuff that should be received
return "HOO " + "%s " % year + "%s " % month + "\n"
server = SimpleXMLRPCServer.SimpleXMLRPCServer(("67.207.145 .173", 8888))
server.register_introspection_functions()
server.register_function(gethari)
print "Listening on port 8888"
server.serve_forever()
Now I am trying to call that service , and get a response . In my wiki
{{gethari (2008 , 8) }}
But I get an error which says
<methodResponse> is an unsupported type
I know that the XML-RPC service is running because test scripts connect fine and produce output OK for eg
#!/usr/bin/python
import xmlrpclib
server = xmlrpclib.ServerProxy("http://67.207.145.173:8888")
month = server.gethari(2002, 8)
print month
Gives proper output "HOO 2002 8"
But the dekiwiki seems to be sending no inputs as seen in the log file
localhost bsc_api # python calendar.py
Listening on port 8888
67-207-145-173.slicehost.net - - [23/Mar/2008 20:09:40] "POST / HTTP/1.0" 200 -
c-66-30-112-141.hsd1.ma.comcast.net - - [23/Mar/2008 20:22:26] "POST /RPC2 HTTP/1.0" 200 -
2002
8
Does anyone know what I can do to write a correct XML-RPC extension that works with dekiwiki in python or perl or any non dot-net language.
Thanks


Reply With Quote
I'll add support for the "official" XML-RPC into Deki Wiki. That should help a bit! However, I'll need to add one more data-type, namely <xml>, which can contain an arbitrary xml document in xml format.
