I am successfully running some webservices with wsapi/xavante. Now I
would like to migrate the thing to Orbit. As I understand it I have to
convert my run() function into a handler which is called by Orbit's
post data dispatcher.
This is the code I am currently using with wsapi/xavante. (The
soap.wsserver is a wsapi adaptation of soap.server)
function run(wsapi_env)
-- export / register our soap methods
soap.wsserver.export(helloDescription)
soap.wsserver.export(helloNumberDescription)
soap.wsserver.export(helloStringDescription)
local ws_request = wsapi.request.new(wsapi_env)
local ws_response = soap.wsserver.handle_request(ws_request)
-- finish() returns status, headers, body iterator function
-- It also calculates Content-Length http header
return ws_response:finish()
end
Trying to convert this to Orbit I ended up with this:
function handleServiceCall(web)
-- export / register our soap methods
soap.wsserver.export(helloDescription)
soap.wsserver.export(helloNumberDescription)
soap.wsserver.export(helloStringDescription)
local ws_request = wsapi.request.new(web.vars)
local ws_response = soap.wsserver.handle_request(ws_request)
-- finish() returns status, headers, body iterator function
-- It also calculates Content-Length http header
return ws_response:finish()
end
soap_orbit:dispatch_post(handleServiceCall, "/services")
Now when I'm trying to call a service I get the following error in Orbit:
Xavante Error: variable 'cookies' is not declared
thread: 0x1001a0600
tcp{client}: 0x10082d428
And the response I get on the client side is:
<html><head><title>Xavante Error!</title></head>
<body>
<h1>Xavante Error!</h1>
<p>variable 'cookies' is not declared</p>
</body></html>
It looks like my code never enters handleServiceCall but already
returns the html with the error before it really handles the request.
What could be going wrong here? I have no clue where this error is
coming from.
Thijs
_______________________________________________
Kepler-Project mailing list
[email protected]
http://lists.luaforge.net/cgi-bin/mailman/listinfo/kepler-project
http://www.keplerproject.org/