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
(DataFlex) 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).
Use ChilkatAx-win32.pkg Procedure Test Handle hoHttp Handle hoXml Boolean iSuccess String sSoapEnvelope String sDomain String sPath Variant vReq Handle hoReq Variant vCert Handle hoCert Variant vResp Handle hoResp Handle hoXmlResp String sTemp1 Boolean bTemp1 // This example requires the Chilkat API to have been previously unlocked. // See Global Unlock Sample for sample code. Get Create (RefClass(cComChilkatHttp)) To hoHttp If (Not(IsComObjectCreated(hoHttp))) Begin Send CreateComObject of hoHttp End Get Create (RefClass(cComChilkatXml)) To hoXml If (Not(IsComObjectCreated(hoXml))) Begin Send CreateComObject of hoXml End Move False To iSuccess // -------------------------------------------------------------------------------- // 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... Set ComTag Of hoXml To "soapenv:Envelope" Get ComAddAttribute Of hoXml "xmlns:soapenv" "http://schemas.xmlsoap.org/soap/envelope/" To iSuccess Get ComAddAttribute Of hoXml "xmlns:stat" "http://statoconsensirichiesta.xsd.fse.ini.finanze.it" To iSuccess Get ComAddAttribute Of hoXml "xmlns:tip" "http://tipodatistatoconsensi.xsd.fse.ini.finanze.it" To iSuccess Send ComUpdateChildContent To hoXml "soapenv:Header" "" Send ComUpdateChildContent To hoXml "soapenv:Body|stat:StatoConsensiRichiesta|stat:IdentificativoUtente" "XXXXXXAAABBBCCC" Send ComUpdateChildContent To hoXml "soapenv:Body|stat:StatoConsensiRichiesta|stat:pinCode" "..." Send ComUpdateChildContent To hoXml "soapenv:Body|stat:StatoConsensiRichiesta|stat:IdentificativoOrganizzazione" "999" Send ComUpdateChildContent To hoXml "soapenv:Body|stat:StatoConsensiRichiesta|stat:StrutturaUtente" "123456789" Send ComUpdateChildContent To hoXml "soapenv:Body|stat:StatoConsensiRichiesta|stat:RuoloUtente" "ZZZ" Send ComUpdateChildContent To hoXml "soapenv:Body|stat:StatoConsensiRichiesta|stat:ContestoOperativo" "" Send ComUpdateChildContent To hoXml "soapenv:Body|stat:StatoConsensiRichiesta|stat:IdentificativoAssistitoGenitoreTutore" "" Send ComUpdateChildContent To hoXml "soapenv:Body|stat:StatoConsensiRichiesta|stat:PresaInCarico" "true" Send ComUpdateChildContent To hoXml "soapenv:Body|stat:StatoConsensiRichiesta|stat:TipoAttivita" "READ" Send ComUpdateChildContent To hoXml "soapenv:Body|stat:StatoConsensiRichiesta|stat:IdentificativoAssistitoConsenso" "ABCDEFGHIJKLM" Get ComGetXml Of hoXml To sSoapEnvelope Move "fseservicetest.sanita.finanze.it" To sDomain Move "/FseInsServicesWeb/services/fseStatoConsensi" To sPath Get Create (RefClass(cComChilkatHttpRequest)) To hoReq If (Not(IsComObjectCreated(hoReq))) Begin Send CreateComObject of hoReq End Set ComHttpVerb Of hoReq To "POST" Set ComSendCharset Of hoReq To False Send ComAddHeader To hoReq "Content-Type" "application/soap+xml; charset=utf-8" Set ComPath Of hoReq To sPath Get ComLoadBodyFromString Of hoReq sSoapEnvelope "utf-8" To iSuccess // 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. Get Create (RefClass(cComChilkatCert)) To hoCert If (Not(IsComObjectCreated(hoCert))) Begin Send CreateComObject of hoCert End Get ComLoadFromSmartcard Of hoCert "" To iSuccess If (iSuccess = False) Begin Get ComLastErrorText Of hoCert To sTemp1 Showln sTemp1 Procedure_Return End // Tell the Chilkat HTTP object to use the certificate for client authentication. Get pvComObject of hoCert to vCert Get ComSetSslClientCert Of hoHttp vCert To iSuccess If (iSuccess = False) Begin Get ComLastErrorText Of hoHttp To sTemp1 Showln sTemp1 Procedure_Return End Set ComTlsVersion Of hoHttp To "TLS 1.1" Get pvComObject of hoReq to vReq Get ComSynchronousRequest Of hoHttp sDomain 443 True vReq To vResp If (IsComObject(vResp)) Begin Get Create (RefClass(cComChilkatHttpResponse)) To hoResp Set pvComObject Of hoResp To vResp End Get ComLastMethodSuccess Of hoHttp To bTemp1 If (bTemp1 = False) Begin Get ComLastErrorText Of hoHttp To sTemp1 Showln sTemp1 Procedure_Return End Get Create (RefClass(cComChilkatXml)) To hoXmlResp If (Not(IsComObjectCreated(hoXmlResp))) Begin Send CreateComObject of hoXmlResp End Get ComBodyStr Of hoResp To sTemp1 Get ComLoadXml Of hoXmlResp sTemp1 To iSuccess Get ComGetXml Of hoXmlResp To sTemp1 Showln sTemp1 Send Destroy of hoResp End_Procedure |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.