krsyoung schrieb:
> Hey all,
> 
> Is it possible to return a SQLObject subclass from a TGWebService
> method?
> 
> In model.py I have:
> 
> class Node(SQLObject):
>     name = StringCol()                  # Node name
>     description = StringCol()           # Node description
> 
> Then in soap.py (subcontroller) I have:
> 
> class SoapController(WebServicesRoot):
> 
>         @wsexpose(Node)
>         @wsvalidate(int)
>         def showServiceRequest(self, p):
>             return Node.get(p)
> 
>         @wsexpose()
>         @wsvalidate(Node)
>         def saveServiceRequest(self, p):
>             Node(p)
> 
> It bombs out with:
>    @wsexpose(Node)
>   File "/usr/local/lib64/python2.4/site-packages/TGWebServices-1.2.0-
> py2.4.egg/tgwebservices/controllers.py", line 146, in entangle
>     register_complex_type(fi, return_type)
>   File "/usr/local/lib64/python2.4/site-packages/TGWebServices-1.2.0-
> py2.4.egg/tgwebservices/runtime.py", line 132, in
> register_complex_type
>     _setup_new_type(checkitem)
>   File "/usr/local/lib64/python2.4/site-packages/TGWebServices-1.2.0-
> py2.4.egg/tgwebservices/runtime.py", line 93, in _setup_new_type
>     cls._type_dependents = 0
> TypeError: can't set attributes of built-in/extension type 'property'
> 
> Do I need to be doing something with typedproperty?  Anybody else have
> something similar working?
> 
> Any ideas or suggestions are much appreciated,

SOAP doesn't know about SO - or any other class for that matter. 
Actually, it doesn't even know about dictionaries. You have to either 
transform your objects to something SOAP/tgwebservices grok (lists of 
primitives or lists again), or teach the marshalling layer new tricks. I 
don't know if the latter is possible in tgwebservices, but I do know 
that ZSI was capable of e.g. marshalling/unmarshalling Java collections 
produced or consumed by apache axis.

I thing your best bet is to use what simplejson offers you, and send the 
resulting objects over the wire. If dicts are supported, that should 
then be all. If not, you need to pass them as sequence of pairs.

Diez

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to