Hi Thijs

The soap call has to make a database query, at the moment I'm using sqlite,
but maybe I better connect to a database server like mysql? Besides that I
was thinking about some kind of login/authentication with sessions.
        I think that persisting a database connection isn't that easy...
You can use the CGILua sessions module to handle login/authentication
issues.

 - If I set soapversion to 1.2 I get the error I reported in my last
message.
What is required to enable 1.2?

       It should work.  I'll take a look.
        I found a bug in cgilua.parsedata()  I'll try to update CGILua,
but I think you can correct it by hand.  In file cgilua/post.lua, line
288 (just add a test for "soap+xml"):

    elseif strfind (contenttype, "application/xml", 1, true) or strfind (contenttype, 
"application/soap+xml", 1, true) or strfind (contenttype, "text/xml", 1, true) or strfind 
(contenttype, "text/plain", 1, true) then

How do you check for valid arguments then? So everything is passed as a
string, and if you need a number you check if a valid number results from
parsing the string?
        Sure.  HTTP is a textual protocol, thus everything will be converted
to text...

       Have you tried it?  The handle_request() should produce a response
to a "?wsdl" request.

Yes I've tried it and it generates something, but it looks quite empty (no
mentioning of arguments or return types) :

<?xml version="1.0" encoding="iso-8859-1"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";><soap:Body><listMethodsResponse><methodName>helloString</methodName><methodName>listMethods</methodName></listMethodsResponse></soap:Body></soap:Envelope>
        This seems to be the HTML response to an empty request sent by a
browser.  Have you tried the same URL but with "?wsdl" appended?

In a script like this, the cgilua.serialize call generates a
soap::ServiceError, and doesn't output anything to the server error log:
        What is the content of this ServiceError?  Are you sure you are
calling cgilua.serialize with the correct arguments?

function helloString(namespace, args)

      These arguments might not be necessary...

What do you mean by that? How do I get to the arguments without a similar
signature?
        I am using a rather simpler signature.  For example, I have:

...
function lista_imagens_galeria (galeria)
        assert (galeria, "Nil argument #1 to 'lista_imagens_galeria'")
-- other assertions

        local imgs = servicos.lista_imagens_galeria (galeria.id)
        local dados = { tag = "ImagensGaleria" }
        for i = 1, #imgs do
                local row = imgs[i]
                dados[i] = {
                        tag = "Imagem",
                        { tag = "codigo", row.codigo },
                        { tag = "sequencial", row.sequencial },
                        { tag = "legenda", row.legenda },
                        { tag = "ordem", row.ordem },
                }
        end
        return dados
end
...
server.export{ ...  }

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

        You can check it with the following code (this is a provisory site):

local client = require"soap.client"

local method = "listaGalerias"
local namespace, method_name, entries = client.call {
        url = "http://139.82.196.20/nucleodememoria/scripts/galerias_soap.lua";,
        soapversion = 1.2,
        method = method,
        entries = {},
}

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

Reply via email to