Tomas,
Thank you for your assistance with this.
Considering your sample server-side object descriptor:
local matricula2URL_descr = {
name = "matricula2URL",
method = matricula2URL,
message = { name = "matricula2URL",
{ name = "matricula", occurrence = 1, type = "string", },
},
response = { name = "matricula2URLResponse",
{ name = "URL", occurrence = 1, type = "string", },
},
}
What server side function does this actually invoke? Something like:
function (occurrence)
return 'somestring'
end
Can this object description syntax be understood in terms of inputs and
outputs?
Also: when I try to call:
soap.server.export(matricula2URL_descr)
I get the error:
/usr/local/share/lua/5.1//soap/server.lua:148: attempt to concatenate field
'soap_action' (a nil value)
stack traceback:
/usr/local/share/lua/5.1//soap/server.lua:148: in function
'wsdl_gen_binding'
/usr/local/share/lua/5.1//soap/server.lua:273: in function 'export'
soap_service.lua:26: in main chunk
'export' calls 'wsdl_gen_binding' , which tries to reference
__service.soap_action, which hasn't been set to anything. And it won't be,
unless
register_service_info is called beforehand--there is no other way for it to
be set. In other words, it looks as though a prerequisite to doing
the 'export' is setting up the WSDL registration before hand; so WSDL
support isn't just an enhancement to be used if desired, it is a necessary
precursor to 'export' anything (or it looks that way).
--WHW
On Mon, Dec 21, 2009 at 8:30 PM, Tomas Guisasola Gorham <
[email protected]> wrote:
> Hi Walter
>
> I am sorry for the so late response, but I was very busy
> the last few weeks.
>
>
> I've been looking at server.lua, and of course there are no instances of
>> SOAP server routines, the user has to provide them. But could you outline
>> the steps for adding a service routine?
>>
> I think that code doesn't make much sense to non-CGILua
> developers... I will try to explain how it is supposed to work.
> The script server.lua is a module to help implement a
> script which should work as a server able to dispatch requests to
> a set of objects. Thus, the objects need to be registered in the
> server's catalog via soap.server.export function, which receives
> a description of the service, such as:
>
> -- Untested code !!!
> local matricula2URL_descr = {
> name = "matricula2URL",
> method = matricula2URL,
> message = { name = "matricula2URL",
> { name = "matricula", occurrence = 1, type = "string", },
> },
> response = { name = "matricula2URLResponse",
> { name = "URL", occurrence = 1, type = "string", },
> },
> }
> soap.server.export(matricula2URL_descr)
>
> After doing that for every object, the server-script might
> call handle_request():
>
> soap.server.handle_request(cgilua.POST[1],
> cgilua.servervariable("QUERY_STRING"))
>
> This function will try to dispatch the request to the
> corresponding object.
>
>
> Also, I'm puzzled by your earlier comment that,
>>
>> There is no automatically-generated WSDL.
>>>>
>>>
>> Almost half of the source code seems to be about that, such as the
>> routine:
>>
> Well, the size of the code that builds SOAP means nothing :-(
>
> function generate_wsdl().
>>
> I use this code, but I will not recommend it to anyone,
> since there are no tests. Anyway, if you are interested, I can
> try to explain how it works.
> The function soap.server.register_service_info just registers
> information needed to respond to WSDL and discovery requests (the
> dispatch might be done by handle_request also). A simple example:
>
> -- Untested code !!!
> local server_name = cgilua.servervariable("SERVER_NAME")
> local path = string.format("http://%s/my/URL/", server_name)
> local script = path.."soap-server-script.lua" -- the name of this script!
>
> local disco = string.format([=[<?xml version="1.0" encoding="iso-8859-1" ?>
> <discovery
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns="http://schemas.xmlsoap.org/disco/">
> <contractRef
> ref="%s?wsdl"
> docRef="%s"
> xmlns="http://schemas.xmlsoap.org/disco/scl/" />
> <soap
> address="%s"
> xmlns:q1="Matricula2URLSoapBind"
> binding="q1:Matricula2URLSoapBind"
> xmlns="http://schemas.xmlsoap.org/disco/soap/" />
> </discovery>]=], script, script, script)
>
> server.register_service_info("matricula2URL", path, script, nil, disco)
>
> The above code should be put before the handle_request call.
> Note that we developed this functions to our needs, but we
> hadn't time to test it properly. I can't even say whether it violates the
> SOAP specification or not, so please, use it at your own risk.
> Anyway, it could be useful.
> Feel free to ask me anything about that.
>
> Regards,
> Tomás
> _______________________________________________
> Kepler-Project mailing list
> [email protected]
> http://lists.luaforge.net/cgi-bin/mailman/listinfo/kepler-project
> http://www.keplerproject.org/
>
_______________________________________________
Kepler-Project mailing list
[email protected]
http://lists.luaforge.net/cgi-bin/mailman/listinfo/kepler-project
http://www.keplerproject.org/