Hi Tomas,


> - My server is now completely stateless. The script is executed, registers
>> its methods, parses the input, executes the functions and then quits. This
>> happens on every soap call.
>>
>        This is how CGI works.


I'm new to CGI as you can tell:)


>
>  What would be good approach to move to an
>> application which is persistent between calls?
>>
>        It depends on the case.  What are you looking for with this change?


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.


>
>  - 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.
>
>
>  - With 1.1 can set soapaction to an empty string or something random, and
>> it
>> still seems to work the same way without errors. Is it ignored?
>>
>        I think your server ignores it (it's redundant, and I think this is
> why version 1.2 obsoletes it).
>
>
Ok then its no problem I guess.


>  - If I specify the type of my arguments, like in the code below, I can
>> still
>> call the function with other types, and it will convert without warning.
>> For
>> a method expecting a string this assertion always passes even though it
>> was
>> passed as a number:
>>
>> assert(type(args[1][1]) == 'string', "First argument to helloString is not
>> a
>> string")
>>
>> This is not a big deal, just wondering.
>>
>        LuaSOAP does not check conformance :-)  It just let things work.
> You can add this kind of check if you want.


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?



>  - I know the wsdl generator is still experimental, but I'd like to try it
>> anyway. How would I change my server script so that "my/url?wsdl"
>> generates
>> a wsdl file?
>>
>        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>



>
>  - If I require "cgilua" then cgilua.serialize is nil. If I require
>> "cgilua.serialize" then nothing is reported to the log when I call it with
>> cgilua.errorlog as its second parameter.
>>
>        This works for me.  Could you elaborate a bit on that?
>


In a script like this, the cgilua.serialize call generates a
soap::ServiceError, and doesn't output anything to the server error log:


require "soap.server"

function helloString(namespace, args)

    cgilua.errorlog("\nnamespace: "..namespace)
    cgilua.errorlog("\narguments: \n")
    cgilua.serialize(args, cgilua.errorlog)
 ....


>
> 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?


Best, Thijs
_______________________________________________
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