Tcl
Tcl
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 Tcl Downloads
load ./chilkat.dll
set success 0
# This example requires the Chilkat API to have been previously unlocked.
# See Global Unlock Sample for sample code.
set http [new_CkHttp]
set xml [new_CkXml]
set success 0
# Create the SOAP envelope...
CkXml_put_Tag $xml "soapenv:Envelope"
CkXml_AddAttribute $xml "xmlns:soapenv" "http://schemas.xmlsoap.org/soap/envelope/"
CkXml_AddAttribute $xml "xmlns:stat" "http://statoconsensirichiesta.xsd.fse.ini.finanze.it"
CkXml_AddAttribute $xml "xmlns:tip" "http://tipodatistatoconsensi.xsd.fse.ini.finanze.it"
CkXml_UpdateChildContent $xml "soapenv:Header" ""
CkXml_UpdateChildContent $xml "soapenv:Body|stat:StatoConsensiRichiesta|stat:IdentificativoUtente" "XXXXXXAAABBBCCC"
CkXml_UpdateChildContent $xml "soapenv:Body|stat:StatoConsensiRichiesta|stat:pinCode" "..."
CkXml_UpdateChildContent $xml "soapenv:Body|stat:StatoConsensiRichiesta|stat:IdentificativoOrganizzazione" "999"
CkXml_UpdateChildContent $xml "soapenv:Body|stat:StatoConsensiRichiesta|stat:StrutturaUtente" "123456789"
CkXml_UpdateChildContent $xml "soapenv:Body|stat:StatoConsensiRichiesta|stat:RuoloUtente" "ZZZ"
CkXml_UpdateChildContent $xml "soapenv:Body|stat:StatoConsensiRichiesta|stat:ContestoOperativo" ""
CkXml_UpdateChildContent $xml "soapenv:Body|stat:StatoConsensiRichiesta|stat:IdentificativoAssistitoGenitoreTutore" ""
CkXml_UpdateChildContent $xml "soapenv:Body|stat:StatoConsensiRichiesta|stat:PresaInCarico" "true"
CkXml_UpdateChildContent $xml "soapenv:Body|stat:StatoConsensiRichiesta|stat:TipoAttivita" "READ"
CkXml_UpdateChildContent $xml "soapenv:Body|stat:StatoConsensiRichiesta|stat:IdentificativoAssistitoConsenso" "ABCDEFGHIJKLM"
set soapEnvelope [CkXml_getXml $xml]
set domain "fseservicetest.sanita.finanze.it"
set path "/FseInsServicesWeb/services/fseStatoConsensi"
set req [new_CkHttpRequest]
CkHttpRequest_put_HttpVerb $req "POST"
CkHttpRequest_put_SendCharset $req 0
CkHttpRequest_AddHeader $req "Content-Type" "application/soap+xml; charset=utf-8"
CkHttpRequest_put_Path $req $path
set success [CkHttpRequest_LoadBodyFromString $req $soapEnvelope "utf-8"]
# User name and Password for Basic Authentication
CkHttp_put_Login $http "XXXXXXAAABBBCCC"
CkHttp_put_Password $http "MYPASSWORD"
set resp [new_CkHttpResponse]
set success [CkHttp_HttpSReq $http $domain 443 1 $req $resp]
if {$success == 0} then {
puts [CkHttp_lastErrorText $http]
delete_CkHttp $http
delete_CkXml $xml
delete_CkHttpRequest $req
delete_CkHttpResponse $resp
exit
}
set xmlResp [new_CkXml]
set success [CkXml_LoadXml $xmlResp [CkHttpResponse_bodyStr $resp]]
puts [CkXml_getXml $xmlResp]
delete_CkHttp $http
delete_CkXml $xml
delete_CkHttpRequest $req
delete_CkHttpResponse $resp
delete_CkXml $xmlResp