Forum OpenACS Q&A: ns_conn content payload

Collapse
Posted by William Byrne on
In reviewing the AOLserver 3.3ad13 code base for the purpose of a SOAP adaptor, I noticed limited support for multipart form POSTs. I also noticed 'ns_conn form' will result in a payload parameter parse. There's a 'content' subcommand for 'ns_conn'; however, it's not implemented. Perhaps my analysis wasn't thorough and overlooked essential code. dunno.

Basically, a SOAP transmission places its RPC/XML in the content section of a FORM POST. A "C" source or Tcl handler would then fetch it in its entirety, parse, then process. To fetch the raw content payload, I guess I could implement a handler that would grab the socket and stream the payload avoiding implicit FORM parameter parsing performed by routines such as 'ns_conn form'. I have the following questions:
  1. Is there an API (Tcl or "C") call that returns raw form content?
  2. Am I correct in that multipart is limited to a single file?
  3. Should I maintain a private copy of revisions for supporting SOAP or should I submit specs and/or code to OpenACS?
  4. Does OpenACS reconcile its AOLServer code base with AOLServer.com?
Collapse
Posted by Don Baccus on
There are already two other approaches to handling SOAP underway.  Dan Wickstrom has demonstrated SOAP integration using his nsjava AOLserver module.  Roberto Mello has been working on getting TclSOAP working (which depends on TclDOM, a fast XML parser written in C that will run as an AOLserver module).  Since OpenACS already uses XML in a few places internally and since we plan to switch to TclDOM, using TclSOAP  would have the least impact on packaging and installation.

You should talk to those folks  before starting an independent effort. Visit https://openacs.org/directory to find their e-mail addresses).  Both also hang out on our IRC channel fairly regularly (openacs on opennet).

As far as reconciling AOLserver changes made here with the AOLserver.com code base, in the past the AOLserver team has picked up many of the changes made by Ars Digita.  The community has no control and very little say in the process, though.  The AOLserver team tends to be conservative in regard to changes, because they're charged with the task of making sure that aol.com, mapquest.com, netscape search and the like not only stay up but are secure.  So I suspect any SOAP support will need to be implemented as an optionally loadable module.

They do make community-provided modules available at the AOLserver.com, it's the core that they're especially conservative with (and rightly so, IMO).

Collapse
Posted by David Walker on
ns_conn content is indeed not implemented. I believe it is implemented in aolserver 4.0.

I wrote a ns_conn_content command as a temporary replacement. If it is important I can try to remember where I put it. It isn't in production anywhere. I needed it for something I started to develop, probably XML for webDAV.
Collapse
Posted by Tom Jackson on

Until I started looking into a form post vunerability in AOLserver, I didn't realize that the post data isn't read unless you call ns_conn form, ns_getform, ns_queryget or ns_querygetall. That makes it nice for anyone who wants to read data after the HTTP headers. Model code for doing this is in the TCL proc ns_queryget, which is in the tcl/form.tcl file. The basic method is to use ns_conncptofp to copy the remaining bytes from the connection to a temporary file, then parse the file. All you would really need to do is replace the parsing routine.

AOLserver 4.0 now has new posted data handling procedures, but you probably want to just write your own tcl based handler so it works with 3.x and 4.x servers.