Lua
Lua
SOAP Request to fseservicetest.sanita.finanze.it with Basic Authentication
See more HTTP Misc Examples
Demonstrates sending a SOAP request to fseservicetest.sanita.finanze.it with Basic Authentication.Chilkat Lua Downloads
local chilkat = require("chilkat")
-- This example requires the Chilkat API to have been previously unlocked.
-- See Global Unlock Sample for sample code.
local http = chilkat.Http.new()
local xml = chilkat.Xml.new()
local success = false
-- Create the SOAP envelope...
xml.tag = "soapenv:Envelope"
xml:add_attribute("xmlns:soapenv", "http://schemas.xmlsoap.org/soap/envelope/")
xml:add_attribute("xmlns:stat", "http://statoconsensirichiesta.xsd.fse.ini.finanze.it")
xml:add_attribute("xmlns:tip", "http://tipodatistatoconsensi.xsd.fse.ini.finanze.it")
xml:update_child_content("soapenv:Header", "")
xml:update_child_content("soapenv:Body|stat:StatoConsensiRichiesta|stat:IdentificativoUtente", "XXXXXXAAABBBCCC")
xml:update_child_content("soapenv:Body|stat:StatoConsensiRichiesta|stat:pinCode", "...")
xml:update_child_content("soapenv:Body|stat:StatoConsensiRichiesta|stat:IdentificativoOrganizzazione", "999")
xml:update_child_content("soapenv:Body|stat:StatoConsensiRichiesta|stat:StrutturaUtente", "123456789")
xml:update_child_content("soapenv:Body|stat:StatoConsensiRichiesta|stat:RuoloUtente", "ZZZ")
xml:update_child_content("soapenv:Body|stat:StatoConsensiRichiesta|stat:ContestoOperativo", "")
xml:update_child_content("soapenv:Body|stat:StatoConsensiRichiesta|stat:IdentificativoAssistitoGenitoreTutore", "")
xml:update_child_content("soapenv:Body|stat:StatoConsensiRichiesta|stat:PresaInCarico", "true")
xml:update_child_content("soapenv:Body|stat:StatoConsensiRichiesta|stat:TipoAttivita", "READ")
xml:update_child_content("soapenv:Body|stat:StatoConsensiRichiesta|stat:IdentificativoAssistitoConsenso", "ABCDEFGHIJKLM")
local soapEnvelope = xml:get_xml()
local domain = "fseservicetest.sanita.finanze.it"
local path = "/FseInsServicesWeb/services/fseStatoConsensi"
local req = chilkat.HttpRequest.new()
req.http_verb = "POST"
req.send_charset = false
req:add_header("Content-Type", "application/soap+xml; charset=utf-8")
req.path = path
success = req:load_body_from_string(soapEnvelope, "utf-8")
-- User name and Password for Basic Authentication
http.login = "XXXXXXAAABBBCCC"
http.password = "MYPASSWORD"
local resp = chilkat.HttpResponse.new()
success = http:http_sreq(domain, 443, true, req, resp)
if not success then
print(http.last_error_text)
return
end
local xmlResp = chilkat.Xml.new()
success = xmlResp:load_xml(resp.body_str)
print(xmlResp:get_xml())