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
(PureBasic) SOAP Request to fseservicetest.sanita.finanze.it with Basic AuthenticationDemonstrates sending a SOAP request to fseservicetest.sanita.finanze.it with Basic Authentication.
IncludeFile "CkHttpResponse.pb" IncludeFile "CkHttp.pb" IncludeFile "CkXml.pb" IncludeFile "CkHttpRequest.pb" Procedure ChilkatExample() ; This example requires the Chilkat API to have been previously unlocked. ; See Global Unlock Sample for sample code. http.i = CkHttp::ckCreate() If http.i = 0 Debug "Failed to create object." ProcedureReturn EndIf xml.i = CkXml::ckCreate() If xml.i = 0 Debug "Failed to create object." ProcedureReturn EndIf success.i = 0 ; Create the SOAP envelope... CkXml::setCkTag(xml, "soapenv:Envelope") CkXml::ckAddAttribute(xml,"xmlns:soapenv","http://schemas.xmlsoap.org/soap/envelope/") CkXml::ckAddAttribute(xml,"xmlns:stat","http://statoconsensirichiesta.xsd.fse.ini.finanze.it") CkXml::ckAddAttribute(xml,"xmlns:tip","http://tipodatistatoconsensi.xsd.fse.ini.finanze.it") CkXml::ckUpdateChildContent(xml,"soapenv:Header","") CkXml::ckUpdateChildContent(xml,"soapenv:Body|stat:StatoConsensiRichiesta|stat:IdentificativoUtente","XXXXXXAAABBBCCC") CkXml::ckUpdateChildContent(xml,"soapenv:Body|stat:StatoConsensiRichiesta|stat:pinCode","...") CkXml::ckUpdateChildContent(xml,"soapenv:Body|stat:StatoConsensiRichiesta|stat:IdentificativoOrganizzazione","999") CkXml::ckUpdateChildContent(xml,"soapenv:Body|stat:StatoConsensiRichiesta|stat:StrutturaUtente","123456789") CkXml::ckUpdateChildContent(xml,"soapenv:Body|stat:StatoConsensiRichiesta|stat:RuoloUtente","ZZZ") CkXml::ckUpdateChildContent(xml,"soapenv:Body|stat:StatoConsensiRichiesta|stat:ContestoOperativo","") CkXml::ckUpdateChildContent(xml,"soapenv:Body|stat:StatoConsensiRichiesta|stat:IdentificativoAssistitoGenitoreTutore","") CkXml::ckUpdateChildContent(xml,"soapenv:Body|stat:StatoConsensiRichiesta|stat:PresaInCarico","true") CkXml::ckUpdateChildContent(xml,"soapenv:Body|stat:StatoConsensiRichiesta|stat:TipoAttivita","READ") CkXml::ckUpdateChildContent(xml,"soapenv:Body|stat:StatoConsensiRichiesta|stat:IdentificativoAssistitoConsenso","ABCDEFGHIJKLM") soapEnvelope.s = CkXml::ckGetXml(xml) domain.s = "fseservicetest.sanita.finanze.it" path.s = "/FseInsServicesWeb/services/fseStatoConsensi" req.i = CkHttpRequest::ckCreate() If req.i = 0 Debug "Failed to create object." ProcedureReturn EndIf CkHttpRequest::setCkHttpVerb(req, "POST") CkHttpRequest::setCkSendCharset(req, 0) CkHttpRequest::ckAddHeader(req,"Content-Type","application/soap+xml; charset=utf-8") CkHttpRequest::setCkPath(req, path) success = CkHttpRequest::ckLoadBodyFromString(req,soapEnvelope,"utf-8") ; User name and Password for Basic Authentication CkHttp::setCkLogin(http, "XXXXXXAAABBBCCC") CkHttp::setCkPassword(http, "MYPASSWORD") resp.i = CkHttp::ckSynchronousRequest(http,domain,443,1,req) If CkHttp::ckLastMethodSuccess(http) = 0 Debug CkHttp::ckLastErrorText(http) CkHttp::ckDispose(http) CkXml::ckDispose(xml) CkHttpRequest::ckDispose(req) ProcedureReturn EndIf xmlResp.i = CkXml::ckCreate() If xmlResp.i = 0 Debug "Failed to create object." ProcedureReturn EndIf success = CkXml::ckLoadXml(xmlResp,CkHttpResponse::ckBodyStr(resp)) Debug CkXml::ckGetXml(xmlResp) CkHttpResponse::ckDispose(resp) CkHttp::ckDispose(http) CkXml::ckDispose(xml) CkHttpRequest::ckDispose(req) CkXml::ckDispose(xmlResp) ProcedureReturn EndProcedure |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.