On Feb 3, 7:11 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> 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

Thanks for the comments/ideas Diez.

>From the lack of documentation I'm guessing few people are actually
using the TGWebServices features...hopefully if I get it working I can
get an update in to 
http://docs.turbogears.org/1.0/WebServices_with_TGWebServices.
I also noticed that tg_flash stops working when I include the
SoapController into controllers.py.  I'm currently running TG 1.0.4b1,
so I'll try getting to 1.0.4 stable and see if that helps.

Also, from the readme it looks like the example on "Custom Objects" is
about what I am looking for...the trouble is trying to figure out if
what I'm doing is wrong, or the examples are broken :-)

http://tgws.googlecode.com/svn/trunk/README.txt

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