Hi Walter

        Sorry for the late response.

However, it fails for POSTs. Note that the code above doesn't protect
against a combination of nil for both postdata and querystring, and I think
this is what's happening. It's crashing and burning because callfunc is
called with nil POST table data.
        I think the code for handle_request does protect for both nil
postdata and querystring (I've put a comment on the corresponding `else'):

function handle_request(postdata, querystring)
    local namespace, func, arg_table
    local header
    if postdata then
        namespace, func, arg_table = decodedata(postdata)
        header = xml_header
    else
        if querystring == "wsdl" then -- WSDL service
            func = function ()
                return __service.wsdl or generate_wsdl()
            end
        elseif querystring == "disco" then -- discovery service
            func = function ()
                return __service.disco or generate_disco()
            end
        else -- no postdata and (querystring ~= "wsdl" and querystring ~= 
"disco")
            func = __methods["listMethods"]
            header = xml_header
        end
        arg_table = {}
    end

    local ok, result = callfunc(func, namespace, arg_table)
    respond(result, header)
end

Now this is surprising because with WireShark, I do see POST requests being
received after the call to your client test routine (test-http.lua) and the
POST has plausible SOAP XML request packets in it. Yet when I look at my log
file of POST table data presented to handle_request, there is nothing. So
the code snippet you sent me:

server.handle_request(cgilua.POST[1],cgilua.servervariable("QUERY_STRING"))

is somehow incomplete or being called the wrong way for POST requests. The
input parameter 'cgilua.POST[1]' does not have valid table data to pass
along to handle_request.
        As I mentioned in the last message, the code I sent you was not
tested :-(  Maybe I wrote something wrong.  You might check if cgilua.POST[1]
is actually what we mean.  You could use cgilua.serialize(var, cgilua.errorlog)
to serialize a value and send the output to your server's log file.

        Now I am finishing some support for SOAP 1.2 and improving some
error messages.  I hope I would have time this week to announce version 2.0
but I can send you the code if you prefer.

        Regards,
                Tomás
_______________________________________________
Kepler-Project mailing list
[email protected]
http://lists.luaforge.net/cgi-bin/mailman/listinfo/kepler-project
http://www.keplerproject.org/

Reply via email to