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
(PowerBuilder) 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).
integer li_rc oleobject loo_Http oleobject loo_Xml integer li_Success string ls_SoapEnvelope string ls_Domain string ls_Path oleobject loo_Req oleobject loo_Cert oleobject loo_Resp oleobject loo_XmlResp // This example requires the Chilkat API to have been previously unlocked. // See Global Unlock Sample for sample code. loo_Http = create oleobject // Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0 li_rc = loo_Http.ConnectToNewObject("Chilkat.Http") if li_rc < 0 then destroy loo_Http MessageBox("Error","Connecting to COM object failed") return end if loo_Xml = create oleobject // Use "Chilkat_9_5_0.Xml" for versions of Chilkat < 10.0.0 li_rc = loo_Xml.ConnectToNewObject("Chilkat.Xml") li_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... loo_Xml.Tag = "soapenv:Envelope" loo_Xml.AddAttribute("xmlns:soapenv","http://schemas.xmlsoap.org/soap/envelope/") loo_Xml.AddAttribute("xmlns:stat","http://statoconsensirichiesta.xsd.fse.ini.finanze.it") loo_Xml.AddAttribute("xmlns:tip","http://tipodatistatoconsensi.xsd.fse.ini.finanze.it") loo_Xml.UpdateChildContent("soapenv:Header","") loo_Xml.UpdateChildContent("soapenv:Body|stat:StatoConsensiRichiesta|stat:IdentificativoUtente","XXXXXXAAABBBCCC") loo_Xml.UpdateChildContent("soapenv:Body|stat:StatoConsensiRichiesta|stat:pinCode","...") loo_Xml.UpdateChildContent("soapenv:Body|stat:StatoConsensiRichiesta|stat:IdentificativoOrganizzazione","999") loo_Xml.UpdateChildContent("soapenv:Body|stat:StatoConsensiRichiesta|stat:StrutturaUtente","123456789") loo_Xml.UpdateChildContent("soapenv:Body|stat:StatoConsensiRichiesta|stat:RuoloUtente","ZZZ") loo_Xml.UpdateChildContent("soapenv:Body|stat:StatoConsensiRichiesta|stat:ContestoOperativo","") loo_Xml.UpdateChildContent("soapenv:Body|stat:StatoConsensiRichiesta|stat:IdentificativoAssistitoGenitoreTutore","") loo_Xml.UpdateChildContent("soapenv:Body|stat:StatoConsensiRichiesta|stat:PresaInCarico","true") loo_Xml.UpdateChildContent("soapenv:Body|stat:StatoConsensiRichiesta|stat:TipoAttivita","READ") loo_Xml.UpdateChildContent("soapenv:Body|stat:StatoConsensiRichiesta|stat:IdentificativoAssistitoConsenso","ABCDEFGHIJKLM") ls_SoapEnvelope = loo_Xml.GetXml() ls_Domain = "fseservicetest.sanita.finanze.it" ls_Path = "/FseInsServicesWeb/services/fseStatoConsensi" loo_Req = create oleobject // Use "Chilkat_9_5_0.HttpRequest" for versions of Chilkat < 10.0.0 li_rc = loo_Req.ConnectToNewObject("Chilkat.HttpRequest") loo_Req.HttpVerb = "POST" loo_Req.SendCharset = 0 loo_Req.AddHeader("Content-Type","application/soap+xml; charset=utf-8") loo_Req.Path = ls_Path li_Success = loo_Req.LoadBodyFromString(ls_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. loo_Cert = create oleobject // Use "Chilkat_9_5_0.Cert" for versions of Chilkat < 10.0.0 li_rc = loo_Cert.ConnectToNewObject("Chilkat.Cert") li_Success = loo_Cert.LoadFromSmartcard("") if li_Success = 0 then Write-Debug loo_Cert.LastErrorText destroy loo_Http destroy loo_Xml destroy loo_Req destroy loo_Cert return end if // Tell the Chilkat HTTP object to use the certificate for client authentication. li_Success = loo_Http.SetSslClientCert(loo_Cert) if li_Success = 0 then Write-Debug loo_Http.LastErrorText destroy loo_Http destroy loo_Xml destroy loo_Req destroy loo_Cert return end if loo_Http.TlsVersion = "TLS 1.1" loo_Resp = loo_Http.SynchronousRequest(ls_Domain,443,1,loo_Req) if loo_Http.LastMethodSuccess = 0 then Write-Debug loo_Http.LastErrorText destroy loo_Http destroy loo_Xml destroy loo_Req destroy loo_Cert return end if loo_XmlResp = create oleobject // Use "Chilkat_9_5_0.Xml" for versions of Chilkat < 10.0.0 li_rc = loo_XmlResp.ConnectToNewObject("Chilkat.Xml") li_Success = loo_XmlResp.LoadXml(loo_Resp.BodyStr) Write-Debug loo_XmlResp.GetXml() destroy loo_Resp destroy loo_Http destroy loo_Xml destroy loo_Req destroy loo_Cert destroy loo_XmlResp |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.