Forum OpenACS Q&A: xmlrpc module for the ACS

Collapse
Posted by hafeez bana on
I Just finished an xmlrpc server module that uses the ns_xml module
from arsdigita. You can find it at
http://www.whyzero.com/~exalter/xmlrpc.tcl

Validates correctly at http://validator.xmlrpc.com

Works with both ACS and openACS (3.x) except with the ACS you need to
patch ns_getform to ignore POST's of text/xml content type.

Search for xmlrpc_proc in the file to look at examples of how to write
functions for xmlrpc.

Any feedback is appreciated.
Thanks,
Hafeez

Collapse
Posted by Ben Adida on
Hafeez, this is excellent news! XML/RPC is an important protocol to support. If you can start taking a look at 4.x and seeing how to make your code conform to the standards of that system (public procedures, etc...), that would be truly excellent. I would like to include XML/RPC functionality in OpenACS 4.x.
Collapse
Posted by Roberto Mello on
I must have missed this when it was originally posted. Very nice Hafeez! I agree with Ben that if it could have a OpenACS 4.x module for it, it'd be _really_ nice.

SOAP would be nice too. I haven't heard of anyone working on a SOAP module, and have no idea how hard it'd be it implement.

Collapse
Posted by Dave Bauer on
SOAP and XML-RPC can be implemented together. What is needed is a generic internal representation of the procedure calls that accepts the parameters and returns the response to the XML-RPC and SOAP interfaces.

That is how Frontier handles it and it seems like a good idea. That said, I am willing to help on getting this working. I also implemented XML-RPC using nsxml based originally on Steve Ball's tclXML and Aaron Swartz's fixes.

Collapse
Posted by hafeez bana on
G'Day,
<P>
Thanks for the comments!
<P>
Sure I wouldn't mind porting the stuff to ACS 4.0 as well as helping out with some other stuff. Question is - how do I get openACS 4.0 builds? For that matter how do I get access to the latest builds of openACS?
<P>
I tried looking for docs and postings about how the contribution process is and couldn't find anything. Ok I admit I wasn't looking that hard. But something in the documentation section would be good. <P>
If someone could post something I could write it up myself.
<P>
Hafeez
Collapse
Posted by Ken Kennedy on
Hafeez:

It looks like the xmlrpc.tcl file no longer validates properly at validator.xmlrpc.com. Didn't they tweak the specs a little while back? It look like it's related to the multi-level nesting stuff, but I'm not sure b/c reading through the proc is making my head spin...*grin*...great job!

If you're getting it to validate, please let me know...maybe I've screwed something up. If not, any ideas on fixing? I'd LOVE to use it...(heck, I'm gonna use it...it's still partially validating even now...)

Collapse
Posted by Ken Kennedy on
Well...in looking through the list at validator.xmlrpc.com, I see both you and Dave's implementation, hafeez. I also see one using AOLServer 3.2+ad12 from wayport.net...any ideas, anyone? Lurkers...anyone? *grin*

Dave, is your implementation available for "public consumption"?? I'm having some validation problems with hafeez's that he's helping me work though; it may be an cfg problem on my machine, or it may be a 3.0->3.2 AOLserver issue (hafeez's module validates on AOLserver 3.0). I'd love to be able to try yours, and see what happens. I might be able to confirm where my problem lies.

Thanks, all!

Collapse
Posted by Ken Kennedy on
*Smack to the side of my own head* OK...now that I've looked at www.thedesignexperience.org, Dave, thanks for the XML-RPC implementation! Downloading now...
Collapse
Posted by Ken Kennedy on

Hmmm...Dave, I'm getting a pretty obvious error at validator.xmlrpc.com:

Ooh, a nasty error: invalid command name "ns_xml_getChildren"

Grepping the tar file, I see a 2 references to "ns_xml_getChildren" in ns_xml-rpc.tcl, but no definition. I see a ns_xml_getChildrenTrim...is that it? Any ideas? Thanks to both you and hafeez in advance...you're doing all the hard work! *grin*

Collapse
Posted by Ken Kennedy on

Excellent!! My validation prbs with hafeez's implementation were simply a result of not using nsd8x (thanks for the quick catch, hafeez!). All is well now on that front. Still getting the same error with your procs, though, Dave. I'm reading through the ns_xml-procs.tcl and ns_xml-rpc.tcl, and trying to compare/contrast to Steve Ball's code (as a reference)...I'll get my head wrapped around it eventually.

Of course, as of right now, I need to be porting bookmarks to ACS4...maybe I'd better do that first...*grin*. But the whole idea of an XML-RPC/SOAP interface into ACS4 would be awesome! Something like Dave Winer's xmlStorage would be almost trivial (famous last words!) with ACS file-storage as the backend. We've got the data storage, we've got the the procs on the backend to interact with the database. Wire in XML-RPC (or SOAP), and you're there!

Collapse
Posted by Don Baccus on
Hey, get to work, Ken! :)

You're right, though, this is exciting stuff and one of the first things to drool over after we get the basic toolkit ported over.

Note that little "after" word...

Collapse
Posted by Ken Kennedy on
I'm working, I'm working...*grin* Sometimes you just can't keep your hands off the shiny new stuff, though...
Collapse
Posted by Don Baccus on
Just like aD and Java ... don't solve today's problems, just get your hands on that shiny new stuff ... :)
Collapse
Posted by Dave Bauer on
I fixed my silly bug. I apparently distributed the old code with bugs in it while my sever ran the fixed version.

While fixing the proc with the wrong name, I also found two more bugs. I took that code and applied it to my server which does validate. Thanks for the feedback. Hopefully I will have more time to work on it to make it better after the porting is done.

Collapse
Posted by carl garland on
I've been messing around with xml-rpc and a few points I thought I might share in case anyone is interested.
  • Adding the introspection and multicall rpc procs
  • Adding overloading
  • Adding parameter checking and fault return in case inproper calls
  • Other various stuff
I've already started but thought I'd check to see if anyone has input and if not if I should put my ideas out for comment. I don't want to detract from rollout though so should I wait to post more for little while?
Collapse
Posted by Don Baccus on
Go ahead and work on it, sure.  Your work will end up in the development branch, not the release branch, so it won't hurt anything.

You might start a new thread to find out what kind of other features folks might want.  A lot of folks will probably miss your comment in this old thread ...