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
Use ChilkatAx-win32.pkg
Procedure Test
Handle hoXml
Boolean iSuccess
String sSoapRequestBody
String sEndpoint
String sSoapAction
String sContentType
Handle hoHttp
Variant vResp
Handle hoResp
Variant vResponseXml
Handle hoResponseXml
Integer iStatusCode
String sGetBusinessUnitsResponse_Id
String sGetBusinessUnitsResponse_Version
String sHeader_UUID
String sHeader_RequestUUID
String sHeader_SendDateTime
String sBusinessUnit
String sSignature_Id
String sSignedInfo_Id
String sCanonicalizationMethod_Algorithm
String sSignatureMethod_Algorithm
String sHMACOutputLength
String sReference_Id
String sReference_URI
String sReference_Type
String sTransform_Algorithm
String sDigestMethod_Algorithm
String sDigestValue
String sSignatureValue
String sKeyInfo_Id
String sObject_Id
String sObject_MimeType
String sObject_Encoding
String sTemp1
Boolean bTemp1
Get Create (RefClass(cComChilkatXml)) To hoXml
If (Not(IsComObjectCreated(hoXml))) Begin
Send CreateComObject of hoXml
End
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:fis" "https://eFiskalizimi.tatime.gov.al/FiscalizationService" To iSuccess
Get ComAddAttribute Of hoXml "xmlns:al" "https://eFiskalizimi.tatime.gov.al/FiscalizationService/schema" To iSuccess
Get ComAddAttribute Of hoXml "xmlns:ds" "http://www.w3.org/2000/09/xmldsig#" To iSuccess
Send ComUpdateChildContent To hoXml "soapenv:Header" ""
Get ComUpdateAttrAt Of hoXml "soapenv:Body|al:GetBusinessUnitsRequest" True "Id" "Request" To iSuccess
Get ComUpdateAttrAt Of hoXml "soapenv:Body|al:GetBusinessUnitsRequest" True "Version" "3" To iSuccess
Get ComUpdateAttrAt Of hoXml "soapenv:Body|al:GetBusinessUnitsRequest|al:Header" True "UUID" "?" To iSuccess
Get ComUpdateAttrAt Of hoXml "soapenv:Body|al:GetBusinessUnitsRequest|al:Header" True "SendDateTime" "?" To iSuccess
Get ComUpdateAttrAt Of hoXml "soapenv:Body|al:GetBusinessUnitsRequest|ds:Signature" True "Id" "?" To iSuccess
Get ComUpdateAttrAt Of hoXml "soapenv:Body|al:GetBusinessUnitsRequest|ds:Signature|ds:SignedInfo" True "Id" "?" To iSuccess
Get ComUpdateAttrAt Of hoXml "soapenv:Body|al:GetBusinessUnitsRequest|ds:Signature|ds:SignedInfo|ds:CanonicalizationMethod" True "Algorithm" "?" To iSuccess
Get ComUpdateAttrAt Of hoXml "soapenv:Body|al:GetBusinessUnitsRequest|ds:Signature|ds:SignedInfo|ds:SignatureMethod" True "Algorithm" "?" To iSuccess
Send ComUpdateChildContent To hoXml "soapenv:Body|al:GetBusinessUnitsRequest|ds:Signature|ds:SignedInfo|ds:SignatureMethod|ds:HMACOutputLength" "integer"
Get ComUpdateAttrAt Of hoXml "soapenv:Body|al:GetBusinessUnitsRequest|ds:Signature|ds:SignedInfo|ds:Reference" True "Id" "?" To iSuccess
Get ComUpdateAttrAt Of hoXml "soapenv:Body|al:GetBusinessUnitsRequest|ds:Signature|ds:SignedInfo|ds:Reference" True "URI" "?" To iSuccess
Get ComUpdateAttrAt Of hoXml "soapenv:Body|al:GetBusinessUnitsRequest|ds:Signature|ds:SignedInfo|ds:Reference" True "Type" "?" To iSuccess
Get ComUpdateAttrAt Of hoXml "soapenv:Body|al:GetBusinessUnitsRequest|ds:Signature|ds:SignedInfo|ds:Reference|ds:Transforms|ds:Transform" True "Algorithm" "?" To iSuccess
Get ComUpdateAttrAt Of hoXml "soapenv:Body|al:GetBusinessUnitsRequest|ds:Signature|ds:SignedInfo|ds:Reference|ds:DigestMethod" True "Algorithm" "?" To iSuccess
Send ComUpdateChildContent To hoXml "soapenv:Body|al:GetBusinessUnitsRequest|ds:Signature|ds:SignedInfo|ds:Reference|ds:DigestValue" "BASE64_DATA"
Send ComUpdateChildContent To hoXml "soapenv:Body|al:GetBusinessUnitsRequest|ds:Signature|ds:SignatureValue" "..."
Get ComUpdateAttrAt Of hoXml "soapenv:Body|al:GetBusinessUnitsRequest|ds:Signature|ds:KeyInfo" True "Id" "?" To iSuccess
Get ComUpdateAttrAt Of hoXml "soapenv:Body|al:GetBusinessUnitsRequest|ds:Signature|ds:Object" True "Id" "?" To iSuccess
Get ComUpdateAttrAt Of hoXml "soapenv:Body|al:GetBusinessUnitsRequest|ds:Signature|ds:Object" True "MimeType" "?" To iSuccess
Get ComUpdateAttrAt Of hoXml "soapenv:Body|al:GetBusinessUnitsRequest|ds:Signature|ds:Object" True "Encoding" "?" To iSuccess
// In a SOAP HTTP request, including the XML declaration (<?xml version="1.0" encoding="UTF-8"?>) in the XML body is generally not required.
Set ComEmitXmlDecl Of hoXml To False
Get ComGetXml Of hoXml To sSoapRequestBody
Move "https://efiskalizimi.tatime.gov.al/FiscalizationService-v3" To sEndpoint
Move "https://eFiskalizimi.tatime.gov.al/FiscalizationService/GetBusinessUnits" To sSoapAction
// For SOAP requests, the standard Content-Type is usually set to "text/xml" or "application/soap+xml"
Move "text/xml" To sContentType
Get Create (RefClass(cComChilkatHttp)) To hoHttp
If (Not(IsComObjectCreated(hoHttp))) Begin
Send CreateComObject of hoHttp
End
Send ComClearHeaders To hoHttp
Send ComSetRequestHeader To hoHttp "Content-Type" sContentType
Send ComSetRequestHeader To hoHttp "SOAPAction" sSoapAction
Get ComPostXml Of hoHttp sEndpoint sSoapRequestBody "utf-8" 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
Showln "Failed to send SOAP request."
Procedure_Return
End
// Get the XML response body.
Get Create (RefClass(cComChilkatXml)) To hoResponseXml
If (Not(IsComObjectCreated(hoResponseXml))) Begin
Send CreateComObject of hoResponseXml
End
Get pvComObject of hoResponseXml to vResponseXml
Get ComGetBodyXml Of hoResp vResponseXml To iSuccess
Get ComStatusCode Of hoResp To iStatusCode
Showln "response status code: " iStatusCode
Send Destroy of hoResp
// If the status code does not indicate succcess, then show the response XML,
// which probably contains error information.
If (iStatusCode <> 200) Begin
Get ComGetXml Of hoResponseXml To sTemp1
Showln sTemp1
Procedure_Return
End
Get ComGetXml Of hoResponseXml To sTemp1
Showln sTemp1
// 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).
Get ComChilkatPath Of hoResponseXml "*:Body|*:GetBusinessUnitsResponse|(Id)" To sGetBusinessUnitsResponse_Id
Get ComChilkatPath Of hoResponseXml "*:Body|*:GetBusinessUnitsResponse|(Version)" To sGetBusinessUnitsResponse_Version
Get ComChilkatPath Of hoResponseXml "*:Body|*:GetBusinessUnitsResponse|*:Header|(UUID)" To sHeader_UUID
Get ComChilkatPath Of hoResponseXml "*:Body|*:GetBusinessUnitsResponse|*:Header|(RequestUUID)" To sHeader_RequestUUID
Get ComChilkatPath Of hoResponseXml "*:Body|*:GetBusinessUnitsResponse|*:Header|(SendDateTime)" To sHeader_SendDateTime
Get ComGetChildContent Of hoResponseXml "*:Body|*:GetBusinessUnitsResponse|*:BusinessUnits|*:BusinessUnit" To sBusinessUnit
Get ComChilkatPath Of hoResponseXml "*:Body|*:GetBusinessUnitsResponse|*:Signature|(Id)" To sSignature_Id
Get ComChilkatPath Of hoResponseXml "*:Body|*:GetBusinessUnitsResponse|*:Signature|*:SignedInfo|(Id)" To sSignedInfo_Id
Get ComChilkatPath Of hoResponseXml "*:Body|*:GetBusinessUnitsResponse|*:Signature|*:SignedInfo|*:CanonicalizationMethod|(Algorithm)" To sCanonicalizationMethod_Algorithm
Get ComChilkatPath Of hoResponseXml "*:Body|*:GetBusinessUnitsResponse|*:Signature|*:SignedInfo|*:SignatureMethod|(Algorithm)" To sSignatureMethod_Algorithm
Get ComGetChildContent Of hoResponseXml "*:Body|*:GetBusinessUnitsResponse|*:Signature|*:SignedInfo|*:SignatureMethod|*:HMACOutputLength" To sHMACOutputLength
Get ComChilkatPath Of hoResponseXml "*:Body|*:GetBusinessUnitsResponse|*:Signature|*:SignedInfo|*:Reference|(Id)" To sReference_Id
Get ComChilkatPath Of hoResponseXml "*:Body|*:GetBusinessUnitsResponse|*:Signature|*:SignedInfo|*:Reference|(URI)" To sReference_URI
Get ComChilkatPath Of hoResponseXml "*:Body|*:GetBusinessUnitsResponse|*:Signature|*:SignedInfo|*:Reference|(Type)" To sReference_Type
Get ComChilkatPath Of hoResponseXml "*:Body|*:GetBusinessUnitsResponse|*:Signature|*:SignedInfo|*:Reference|*:Transforms|*:Transform|(Algorithm)" To sTransform_Algorithm
Get ComChilkatPath Of hoResponseXml "*:Body|*:GetBusinessUnitsResponse|*:Signature|*:SignedInfo|*:Reference|*:DigestMethod|(Algorithm)" To sDigestMethod_Algorithm
Get ComGetChildContent Of hoResponseXml "*:Body|*:GetBusinessUnitsResponse|*:Signature|*:SignedInfo|*:Reference|*:DigestValue" To sDigestValue
Get ComGetChildContent Of hoResponseXml "*:Body|*:GetBusinessUnitsResponse|*:Signature|*:SignatureValue" To sSignatureValue
Get ComChilkatPath Of hoResponseXml "*:Body|*:GetBusinessUnitsResponse|*:Signature|*:KeyInfo|(Id)" To sKeyInfo_Id
Get ComChilkatPath Of hoResponseXml "*:Body|*:GetBusinessUnitsResponse|*:Signature|*:Object|(Id)" To sObject_Id
Get ComChilkatPath Of hoResponseXml "*:Body|*:GetBusinessUnitsResponse|*:Signature|*:Object|(MimeType)" To sObject_MimeType
Get ComChilkatPath Of hoResponseXml "*:Body|*:GetBusinessUnitsResponse|*:Signature|*:Object|(Encoding)" To sObject_Encoding
End_Procedure
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>