Looks like all you need is the filter. So the final code:
from cherrypy.lib.filter.xmlrpcfilter import XmlRpcFilter
import turbogears
class XMLEndpointController(object):
_cpFilterList = [XmlRpcFilter()]
@turbogears.expose()
def index(self, **data):
print '--Yummy XML Data--', data.keys()[0]
return "<response>Good</response>"
Tried adding this to config/app.cfg, but didn't seem to take
[/rpc]
xmlrpc_filter.on = True
xmlrpc_filter.encoding = 'latin-1'
On Dec 19, 12:35 pm, Owen Mead-Robins <[email protected]> wrote:
> I can do it by using straight Cherrypy and Cherrypy filter as such:
>
> from cherrypy.lib.filter.xmlrpcfilter import XmlRpcFilter
> class XMLEndpointController(object):
> _cpFilterList = [XmlRpcFilter()]
>
> def index(self, **data):
> print '--Yummy XML Data--', data.keys()[0]
> return "<response>Good</response>"
> index.exposed = True
>
> Be nice to be able to use the turbgogears expose decorator instead, or
> a least a more turbogearsy way to do this.
>
> On Dec 19, 12:14 pm, Owen Mead-Robins <[email protected]> wrote:
>
> > The goal is to be able to run the following:
> > curlhttp://myserver:8080/xml-in/-d'[some lovely xml]'
>
> > On the TurboGears side I'm not entirely sure how to do this. Running
> > the above gives:
> > ValueError: too many values to unpack
>
> > I can get around this by:
> > curlhttp://myserver:8080/xml-in/-d'data=[some lovely xml]'
>
> > However, I'd like to not have to specify the redundant 'data' keyword.
>
> > Thanks in advance for any help or insights,
> > -Owen
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---