SOAP WSDL Generate Code

FiscalizationServiceSoap / getBusinessUnits

ASP AutoIt C C (Unicode) C++ C++ (Unicode) C# DataFlex Delphi Foxpro Go Java Node.js Objective-C Perl PHP Extension PowerBuilder Powershell PureBasic Python CkPython Ruby SQL Server Swift TCL VB.NET VB6 VBScript Xojo
#import <CkoXml.h>
#import <NSString.h>
#import <CkoHttp.h>
#import <CkoHttpResponse.h>

CkoXml *xml = [[CkoXml alloc] init];
xml.Tag = @"soapenv:Envelope";
[xml AddAttribute: @"xmlns:soapenv" value: @"http://schemas.xmlsoap.org/soap/envelope/"];
[xml AddAttribute: @"xmlns:fis" value: @"https://eFiskalizimi.tatime.gov.al/FiscalizationService"];
[xml AddAttribute: @"xmlns:al" value: @"https://eFiskalizimi.tatime.gov.al/FiscalizationService/schema"];
[xml AddAttribute: @"xmlns:ds" value: @"http://www.w3.org/2000/09/xmldsig#"];
[xml UpdateChildContent: @"soapenv:Header" value: @""];
[xml UpdateAttrAt: @"soapenv:Body|al:GetBusinessUnitsRequest" autoCreate: YES attrName: @"Id" attrValue: @"Request"];
[xml UpdateAttrAt: @"soapenv:Body|al:GetBusinessUnitsRequest" autoCreate: YES attrName: @"Version" attrValue: @"3"];
[xml UpdateAttrAt: @"soapenv:Body|al:GetBusinessUnitsRequest|al:Header" autoCreate: YES attrName: @"UUID" attrValue: @"?"];
[xml UpdateAttrAt: @"soapenv:Body|al:GetBusinessUnitsRequest|al:Header" autoCreate: YES attrName: @"SendDateTime" attrValue: @"?"];
[xml UpdateAttrAt: @"soapenv:Body|al:GetBusinessUnitsRequest|ds:Signature" autoCreate: YES attrName: @"Id" attrValue: @"?"];
[xml UpdateAttrAt: @"soapenv:Body|al:GetBusinessUnitsRequest|ds:Signature|ds:SignedInfo" autoCreate: YES attrName: @"Id" attrValue: @"?"];
[xml UpdateAttrAt: @"soapenv:Body|al:GetBusinessUnitsRequest|ds:Signature|ds:SignedInfo|ds:CanonicalizationMethod" autoCreate: YES attrName: @"Algorithm" attrValue: @"?"];
[xml UpdateAttrAt: @"soapenv:Body|al:GetBusinessUnitsRequest|ds:Signature|ds:SignedInfo|ds:SignatureMethod" autoCreate: YES attrName: @"Algorithm" attrValue: @"?"];
[xml UpdateChildContent: @"soapenv:Body|al:GetBusinessUnitsRequest|ds:Signature|ds:SignedInfo|ds:SignatureMethod|ds:HMACOutputLength" value: @"integer"];
[xml UpdateAttrAt: @"soapenv:Body|al:GetBusinessUnitsRequest|ds:Signature|ds:SignedInfo|ds:Reference" autoCreate: YES attrName: @"Id" attrValue: @"?"];
[xml UpdateAttrAt: @"soapenv:Body|al:GetBusinessUnitsRequest|ds:Signature|ds:SignedInfo|ds:Reference" autoCreate: YES attrName: @"URI" attrValue: @"?"];
[xml UpdateAttrAt: @"soapenv:Body|al:GetBusinessUnitsRequest|ds:Signature|ds:SignedInfo|ds:Reference" autoCreate: YES attrName: @"Type" attrValue: @"?"];
[xml UpdateAttrAt: @"soapenv:Body|al:GetBusinessUnitsRequest|ds:Signature|ds:SignedInfo|ds:Reference|ds:Transforms|ds:Transform" autoCreate: YES attrName: @"Algorithm" attrValue: @"?"];
[xml UpdateAttrAt: @"soapenv:Body|al:GetBusinessUnitsRequest|ds:Signature|ds:SignedInfo|ds:Reference|ds:DigestMethod" autoCreate: YES attrName: @"Algorithm" attrValue: @"?"];
[xml UpdateChildContent: @"soapenv:Body|al:GetBusinessUnitsRequest|ds:Signature|ds:SignedInfo|ds:Reference|ds:DigestValue" value: @"BASE64_DATA"];
[xml UpdateChildContent: @"soapenv:Body|al:GetBusinessUnitsRequest|ds:Signature|ds:SignatureValue" value: @"..."];
[xml UpdateAttrAt: @"soapenv:Body|al:GetBusinessUnitsRequest|ds:Signature|ds:KeyInfo" autoCreate: YES attrName: @"Id" attrValue: @"?"];
[xml UpdateAttrAt: @"soapenv:Body|al:GetBusinessUnitsRequest|ds:Signature|ds:Object" autoCreate: YES attrName: @"Id" attrValue: @"?"];
[xml UpdateAttrAt: @"soapenv:Body|al:GetBusinessUnitsRequest|ds:Signature|ds:Object" autoCreate: YES attrName: @"MimeType" attrValue: @"?"];
[xml UpdateAttrAt: @"soapenv:Body|al:GetBusinessUnitsRequest|ds:Signature|ds:Object" autoCreate: YES attrName: @"Encoding" attrValue: @"?"];

// In a SOAP HTTP request, including the XML declaration (<?xml version="1.0" encoding="UTF-8"?>) in the XML body is generally not required. 
xml.EmitXmlDecl = NO;
NSString *soapRequestBody = [xml GetXml];

NSString *endpoint = @"https://efiskalizimi.tatime.gov.al/FiscalizationService-v3";
NSString *soapAction = @"https://eFiskalizimi.tatime.gov.al/FiscalizationService/GetBusinessUnits";
//  For SOAP requests, the standard Content-Type is usually set to "text/xml" or "application/soap+xml"
NSString *contentType = @"text/xml";

CkoHttp *http = [[CkoHttp alloc] init];

[http ClearHeaders];
[http SetRequestHeader: @"Content-Type" value: contentType];
[http SetRequestHeader: @"SOAPAction" value: soapAction];

CkoHttpResponse *resp = [http PostXml: endpoint xmlDoc: soapRequestBody charset: @"utf-8"];
if (http.LastMethodSuccess == NO) {
    NSLog(@"%@",http.LastErrorText);
    NSLog(@"%@",@"Failed to send SOAP request.");
    return;
}

// Get the XML response body.
CkoXml *responseXml = [[CkoXml alloc] init];
[resp GetBodyXml: responseXml];

int statusCode = [resp.StatusCode intValue];
NSLog(@"%@%d",@"response status code: ",statusCode);

// If the status code does not indicate succcess, then show the response XML,
// which probably contains error information.
if (statusCode != 200) {
    NSLog(@"%@",[responseXml GetXml]);
    return;
}

NSLog(@"%@",[responseXml GetXml]);

// Parse the successful SOAP response XML.

// This is a sample of the response XML, but the namespace prefixes will be different.
// We can parse the result using "*" for the namespace prefixes (see below).

NSString *GetBusinessUnitsResponse_Id = [responseXml ChilkatPath: @"*:Body|*:GetBusinessUnitsResponse|(Id)"];
NSString *GetBusinessUnitsResponse_Version = [responseXml ChilkatPath: @"*:Body|*:GetBusinessUnitsResponse|(Version)"];
NSString *Header_UUID = [responseXml ChilkatPath: @"*:Body|*:GetBusinessUnitsResponse|*:Header|(UUID)"];
NSString *Header_RequestUUID = [responseXml ChilkatPath: @"*:Body|*:GetBusinessUnitsResponse|*:Header|(RequestUUID)"];
NSString *Header_SendDateTime = [responseXml ChilkatPath: @"*:Body|*:GetBusinessUnitsResponse|*:Header|(SendDateTime)"];
NSString *BusinessUnit = [responseXml GetChildContent: @"*:Body|*:GetBusinessUnitsResponse|*:BusinessUnits|*:BusinessUnit"];
NSString *Signature_Id = [responseXml ChilkatPath: @"*:Body|*:GetBusinessUnitsResponse|*:Signature|(Id)"];
NSString *SignedInfo_Id = [responseXml ChilkatPath: @"*:Body|*:GetBusinessUnitsResponse|*:Signature|*:SignedInfo|(Id)"];
NSString *CanonicalizationMethod_Algorithm = [responseXml ChilkatPath: @"*:Body|*:GetBusinessUnitsResponse|*:Signature|*:SignedInfo|*:CanonicalizationMethod|(Algorithm)"];
NSString *SignatureMethod_Algorithm = [responseXml ChilkatPath: @"*:Body|*:GetBusinessUnitsResponse|*:Signature|*:SignedInfo|*:SignatureMethod|(Algorithm)"];
NSString *HMACOutputLength = [responseXml GetChildContent: @"*:Body|*:GetBusinessUnitsResponse|*:Signature|*:SignedInfo|*:SignatureMethod|*:HMACOutputLength"];
NSString *Reference_Id = [responseXml ChilkatPath: @"*:Body|*:GetBusinessUnitsResponse|*:Signature|*:SignedInfo|*:Reference|(Id)"];
NSString *Reference_URI = [responseXml ChilkatPath: @"*:Body|*:GetBusinessUnitsResponse|*:Signature|*:SignedInfo|*:Reference|(URI)"];
NSString *Reference_Type = [responseXml ChilkatPath: @"*:Body|*:GetBusinessUnitsResponse|*:Signature|*:SignedInfo|*:Reference|(Type)"];
NSString *Transform_Algorithm = [responseXml ChilkatPath: @"*:Body|*:GetBusinessUnitsResponse|*:Signature|*:SignedInfo|*:Reference|*:Transforms|*:Transform|(Algorithm)"];
NSString *DigestMethod_Algorithm = [responseXml ChilkatPath: @"*:Body|*:GetBusinessUnitsResponse|*:Signature|*:SignedInfo|*:Reference|*:DigestMethod|(Algorithm)"];
NSString *DigestValue = [responseXml GetChildContent: @"*:Body|*:GetBusinessUnitsResponse|*:Signature|*:SignedInfo|*:Reference|*:DigestValue"];
NSString *SignatureValue = [responseXml GetChildContent: @"*:Body|*:GetBusinessUnitsResponse|*:Signature|*:SignatureValue"];
NSString *KeyInfo_Id = [responseXml ChilkatPath: @"*:Body|*:GetBusinessUnitsResponse|*:Signature|*:KeyInfo|(Id)"];
NSString *Object_Id = [responseXml ChilkatPath: @"*:Body|*:GetBusinessUnitsResponse|*:Signature|*:Object|(Id)"];
NSString *Object_MimeType = [responseXml ChilkatPath: @"*:Body|*:GetBusinessUnitsResponse|*:Signature|*:Object|(MimeType)"];
NSString *Object_Encoding = [responseXml ChilkatPath: @"*:Body|*:GetBusinessUnitsResponse|*:Signature|*:Object|(Encoding)"];
Request XML
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:fis="https://eFiskalizimi.tatime.gov.al/FiscalizationService" xmlns:al="https://eFiskalizimi.tatime.gov.al/FiscalizationService/schema" xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
    <soapenv:Header/>
    <soapenv:Body>
        <al:GetBusinessUnitsRequest Id="Request" Version="3">
            <al:Header UUID="?" SendDateTime="?"/>
            <ds:Signature Id="?">
                <ds:SignedInfo Id="?">
                    <ds:CanonicalizationMethod Algorithm="?"/>
                    <ds:SignatureMethod Algorithm="?">
                        <ds:HMACOutputLength>integer</ds:HMACOutputLength>
                    </ds:SignatureMethod>
                    <ds:Reference Id="?" URI="?" Type="?">
                        <ds:Transforms>
                            <ds:Transform Algorithm="?"/>
                        </ds:Transforms>
                        <ds:DigestMethod Algorithm="?"/>
                        <ds:DigestValue>BASE64_DATA</ds:DigestValue>
                    </ds:Reference>
                </ds:SignedInfo>
                <ds:SignatureValue>...</ds:SignatureValue>
                <ds:KeyInfo Id="?"/>
                <ds:Object Id="?" MimeType="?" Encoding="?"/>
            </ds:Signature>
        </al:GetBusinessUnitsRequest>
    </soapenv:Body>
</soapenv:Envelope>
Response XML
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:fis="https://eFiskalizimi.tatime.gov.al/FiscalizationService" xmlns:al="https://eFiskalizimi.tatime.gov.al/FiscalizationService/schema" xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
    <soapenv:Header/>
    <soapenv:Body>
        <al:GetBusinessUnitsResponse Id="Response" Version="3">
            <al:Header UUID="?" RequestUUID="?" SendDateTime="?"/>
            <al:BusinessUnits>
                <al:BusinessUnit>...</al:BusinessUnit>
            </al:BusinessUnits>
            <ds:Signature Id="?">
                <ds:SignedInfo Id="?">
                    <ds:CanonicalizationMethod Algorithm="?"/>
                    <ds:SignatureMethod Algorithm="?">
                        <ds:HMACOutputLength>integer</ds:HMACOutputLength>
                    </ds:SignatureMethod>
                    <ds:Reference Id="?" URI="?" Type="?">
                        <ds:Transforms>
                            <ds:Transform Algorithm="?"/>
                        </ds:Transforms>
                        <ds:DigestMethod Algorithm="?"/>
                        <ds:DigestValue>BASE64_DATA</ds:DigestValue>
                    </ds:Reference>
                </ds:SignedInfo>
                <ds:SignatureValue>...</ds:SignatureValue>
                <ds:KeyInfo Id="?"/>
                <ds:Object Id="?" MimeType="?" Encoding="?"/>
            </ds:Signature>
        </al:GetBusinessUnitsResponse>
    </soapenv:Body>
</soapenv:Envelope>