Chilkat HOME .NET Core C# Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi ActiveX Delphi DLL Go Java Lianja Mono C# Node.js Objective-C PHP ActiveX PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(Tcl) SOAP Request to fseservicetest.sanita.finanze.it with Smart Card Authentication (TS-CNS Italian Card)Demonstrates sending a SOAP request to fseservicetest.sanita.finanze.it with Smart Card (TS-CNS Italian Card).
load ./chilkat.dll # 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 # -------------------------------------------------------------------------------- # Also see Chilkat's Online WSDL Code Generator # to generate code and SOAP Request and Response XML for each operation in a WSDL. # -------------------------------------------------------------------------------- # 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"] # Load the default certificate from the smartcard currently in the reader. # (This assumes only one reader with one smartcard containing one certificate. # If the situation is more complex, you can do it with Chilkat, but it requires # using the Chilkat certificate store object to get the desired certificate # from the desired smart card.) # # Note: This is for Windows-only. set cert [new_CkCert] set success [CkCert_LoadFromSmartcard $cert ""] if {$success == 0} then { puts [CkCert_lastErrorText $cert] delete_CkHttp $http delete_CkXml $xml delete_CkHttpRequest $req delete_CkCert $cert exit } # Tell the Chilkat HTTP object to use the certificate for client authentication. set success [CkHttp_SetSslClientCert $http $cert] if {$success == 0} then { puts [CkHttp_lastErrorText $http] delete_CkHttp $http delete_CkXml $xml delete_CkHttpRequest $req delete_CkCert $cert exit } CkHttp_put_TlsVersion $http "TLS 1.1" # resp is a CkHttpResponse set resp [CkHttp_SynchronousRequest $http $domain 443 1 $req] if {[CkHttp_get_LastMethodSuccess $http] == 0} then { puts [CkHttp_lastErrorText $http] delete_CkHttp $http delete_CkXml $xml delete_CkHttpRequest $req delete_CkCert $cert exit } set xmlResp [new_CkXml] set success [CkXml_LoadXml $xmlResp [CkHttpResponse_bodyStr $resp]] puts [CkXml_getXml $xmlResp] delete_CkHttpResponse $resp delete_CkHttp $http delete_CkXml $xml delete_CkHttpRequest $req delete_CkCert $cert delete_CkXml $xmlResp |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.