[ul][li]LuaSOAP needs LuaExpat[/li]
[li]LuaExpat needs Expat[/li]
[li]Expat is written in C[/li][/ul]
You could compile and deploy the Expat lib directly to Vera, but your code would be harder for others to deploy.
You might want to jump in on this thread, since that would also pull in the libs you need, since a number of different high-level API’s all depend upon this same low level one:
It would enable a LOT of things to be done if it were added.
I haven’t tried it, but as an alternative, you might be able to [tt]os.execute()[/tt] out to [tt]curl[/tt]. You’d end up having to write and read, and delete, a bunch of Temporary files to achieve the same effect as a real API, so I didn’t bother trying it.
It’s possible to call a soap server with curl from vera2.
Perhaps I could do better but it’s to train me lua code.
here’s the code:
-------------------------------------------------------------------------------------
-- SOAP client POST with curl by Gilles ---
-------------------------------------------------------------------------------------
-- a function to excute a shell command
function execute(command)
local file = io.popen (command)
local data = file:read("*a")
file:close()
if (data == "") then
data = nil
end
--print(data)
return data
end
--here you put the request enveloppe for the SOAP server wich call the function getHelloWorld or what else
local req = [[<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.gilles.example.fr/ns"><SOAP-ENV:Body><ns1:getHelloWorld/></SOAP-ENV:Body></SOAP-ENV:Envelope>]]
file_req = io.open("req.lua", "w") -- déclare in a file for using with curl
file_req:write(req) --write in this file your soap enveloppe
local local_url = [[ http://myserver.loc/soap_server/]] --the adress of your soap server
local conc = [[curl -s -X POST -d@]] .. "req.lua" .. local_url -- the concatenation of the curl command
local temp = execute(conc) --the excution of the curl command
print (temp) -- a print check
file_req:close() -- close the file file_req used for soap enveloppe