This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

TESA Assa Abloy SOAP API
#2
Try this example, change host and parameters inside body variable as needed. Keep in mind that for other services like users you need to change service variable according to the documentation.
Code:
function soaprequest(host, service, body)
  local ltn12 = require('ltn12')
  local https = require('ssl.https')
  local sink = {}

  local res, err = https.request({
    url = 'https://' .. host .. ':8181/ServerPlatform/' .. service,
    method = 'POST',
    headers = {
      ['Content-Length'] = #body,
    },
    sink = ltn12.sink.table(sink),
    source = ltn12.source.string(body),
  })

  if res then
    return table.concat(sink)
  else
    return nil, err
  end
end

host = '192.168.1.1'
service = 'DoorsWebService'
body = [[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://soap.ws.ts1000.tesa.es/">
<soapenv:Header/>
<soapenv:Body>
<soap:doorClose>
<operatorName>operator1</operatorName>
<operatorPassword>myPassword1</operatorPassword>
<doorName>door1</doorName>
</soap:doorClose>
</soapenv:Body>
</soapenv:Envelope>]]

res, err = soaprequest(host, service, body)
log(res, err)
Reply


Messages In This Thread
TESA Assa Abloy SOAP API - by pentadom - 21.04.2020, 10:41
RE: TESA Assa Abloy SOAP API - by admin - 21.04.2020, 10:56
RE: TESA Assa Abloy SOAP API - by ffrr12 - 07.07.2023, 08:10

Forum Jump: