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
(Objective-C) SOAP Request to fseservicetest.sanita.finanze.it with Basic AuthenticationDemonstrates sending a SOAP request to fseservicetest.sanita.finanze.it with Basic Authentication.
#import <CkoHttp.h> #import <CkoXml.h> #import <NSString.h> #import <CkoHttpRequest.h> #import <CkoHttpResponse.h> // This example requires the Chilkat API to have been previously unlocked. // See Global Unlock Sample for sample code. CkoHttp *http = [[CkoHttp alloc] init]; CkoXml *xml = [[CkoXml alloc] init]; BOOL success = NO; // Create the SOAP envelope... xml.Tag = @"soapenv:Envelope"; [xml AddAttribute: @"xmlns:soapenv" value: @"http://schemas.xmlsoap.org/soap/envelope/"]; [xml AddAttribute: @"xmlns:stat" value: @"http://statoconsensirichiesta.xsd.fse.ini.finanze.it"]; [xml AddAttribute: @"xmlns:tip" value: @"http://tipodatistatoconsensi.xsd.fse.ini.finanze.it"]; [xml UpdateChildContent: @"soapenv:Header" value: @""]; [xml UpdateChildContent: @"soapenv:Body|stat:StatoConsensiRichiesta|stat:IdentificativoUtente" value: @"XXXXXXAAABBBCCC"]; [xml UpdateChildContent: @"soapenv:Body|stat:StatoConsensiRichiesta|stat:pinCode" value: @"..."]; [xml UpdateChildContent: @"soapenv:Body|stat:StatoConsensiRichiesta|stat:IdentificativoOrganizzazione" value: @"999"]; [xml UpdateChildContent: @"soapenv:Body|stat:StatoConsensiRichiesta|stat:StrutturaUtente" value: @"123456789"]; [xml UpdateChildContent: @"soapenv:Body|stat:StatoConsensiRichiesta|stat:RuoloUtente" value: @"ZZZ"]; [xml UpdateChildContent: @"soapenv:Body|stat:StatoConsensiRichiesta|stat:ContestoOperativo" value: @""]; [xml UpdateChildContent: @"soapenv:Body|stat:StatoConsensiRichiesta|stat:IdentificativoAssistitoGenitoreTutore" value: @""]; [xml UpdateChildContent: @"soapenv:Body|stat:StatoConsensiRichiesta|stat:PresaInCarico" value: @"true"]; [xml UpdateChildContent: @"soapenv:Body|stat:StatoConsensiRichiesta|stat:TipoAttivita" value: @"READ"]; [xml UpdateChildContent: @"soapenv:Body|stat:StatoConsensiRichiesta|stat:IdentificativoAssistitoConsenso" value: @"ABCDEFGHIJKLM"]; NSString *soapEnvelope = [xml GetXml]; NSString *domain = @"fseservicetest.sanita.finanze.it"; NSString *path = @"/FseInsServicesWeb/services/fseStatoConsensi"; CkoHttpRequest *req = [[CkoHttpRequest alloc] init]; req.HttpVerb = @"POST"; req.SendCharset = NO; [req AddHeader: @"Content-Type" value: @"application/soap+xml; charset=utf-8"]; req.Path = path; success = [req LoadBodyFromString: soapEnvelope charset: @"utf-8"]; // User name and Password for Basic Authentication http.Login = @"XXXXXXAAABBBCCC"; http.Password = @"MYPASSWORD"; CkoHttpResponse *resp = [http SynchronousRequest: domain port: [NSNumber numberWithInt: 443] ssl: YES req: req]; if (http.LastMethodSuccess == NO) { NSLog(@"%@",http.LastErrorText); return; } CkoXml *xmlResp = [[CkoXml alloc] init]; success = [xmlResp LoadXml: resp.BodyStr]; NSLog(@"%@",[xmlResp GetXml]); |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.