Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I've done it.

Use case involves a class wrapping python's xml-rpc stuff to talk to Drupal.

Drupal's xml-rpc interface is not the most pleasant thing to work with, as you have to pass in a session id and auth token on every request, and then all the "actual" parameters go in as an array.

My wrapper class would query the remote interface for available methods, and then dynamically generate, via eval, a function object that used a closure to store the sess/auth tokens, and that took a variable number of arguments to pass as the 3rd array argument to the function. The eval'd function object was then bound as a method to the connection object.

It also did a bit more magic, such as on error logging the arguments to a file. ALl in all it made writing web-service clients a lot more pleasant.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: