I am writing the database definition for my documentation. Is there not a
way to use xmlrpc to export the schema? Here was my first attempt:
@service.xmlrpc
def schema(table=None):
"returns the table schema or database schema when argument is None"
return db.executesql('.schema')
The .schema command came from
http://stackoverflow.com/questions/604939/how-can-i-get-the-list-of-a-columns-in-a-table-for-a-sqlite-database
Then I called: http://127.0.0.1:8000/TAMOTO_DEV/default/call/xml/schema
but the browser returned "Object does not exist"
So I tried debugging by first confirming @service.xmlrpc works by using the
example from the book:
@service.run
@service.xmlrpc
def concat(a,b):
return a+b
But the call
http://127.0.0.1:8000/TAMOTO_DEV/default/call/xml/concat?a=hello&b=world
returned:
XML Parsing Error: syntax error
Location:
http://127.0.0.1:8000/TAMOTO_DEV/default/call/xml/concat?a=hello&b=world
Line Number 1, Column 39:<?xml version="1.0" encoding="UTF-8"?>helloworld
---------------------------------------------------------------------------------------------------^
I expected:
<document>
<result>helloworld</result>
</document>
Like in the book.
Thanks for your insight.
Regards,
Bill