/usr/share/lua/5.1/soap/http.lua is in liblua5.1-soap0 1.0b-7.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | ---------------------------------------------------------------------
-- SOAP over HTTP.
-- See Copyright notice in license.html
-- $Id: http.lua,v 1.1 2004/03/24 19:27:37 tomas Exp $
---------------------------------------------------------------------
require"socket.http"
require"ltn12"
require"soap"
local post = socket.http.post
soap.http = {}
---------------------------------------------------------------------
-- Call a remote method.
-- @param url String with the location of the server.
-- @param namespace
---------------------------------------------------------------------
function soap.http.call (url, namespace, method, entries, headers)
local body = {}
local data = soap.encode (namespace, method, entries, headers)
local rc, code, headers = socket.http.request {
url = url,
method = "POST",
source = ltn12.source.string(data),
headers = {
["Content-type"] = "text/xml",
["SOAPAction"] = '"'..method..'"',
["Content-length"] = tostring(string.len(data)),
},
sink = ltn12.sink.table(body)
}
body = table.concat(body)
if rc == 1 and tonumber (code) == 200 then
return soap.decode (body)
else
error (code.."\n\n"..body)
end
end
|