Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Event Request] Codeunit 10752 - Procedure InvokeBatchSoapRequest - OnAfterGetIsolatedCertificate #28160

Open
SngMarioSopena opened this issue Feb 17, 2025 · 0 comments

Comments

@SngMarioSopena
Copy link

Describe the request

Image

local procedure InvokeBatchSoapRequest(SIISession: Record "SII Session"; var TempSIIHistoryBuffer: Record "SII History" temporary; RequestText: Text; RequestType: Option InvoiceIssuedRegistration,InvoiceReceivedRegistration,PaymentSentRegistration,PaymentReceivedRegistration,CollectionInCashRegistration; var ResponseText: Text): Boolean
    var
        CertificateEnabled: Boolean;
        Cert: DotNet X509Certificate2;
        WebRequest: DotNet WebRequest;
        HttpWebRequest: DotNet HttpWebRequest;
        RequestStream: DotNet Stream;
        Encoding: DotNet Encoding;
        ByteArray: DotNet Array;
        Uri: DotNet Uri;
        HttpWebResponse: DotNet HttpWebResponse;
        StatusCode: DotNet HttpStatusCode;
        WebServiceUrl: Text;
        StatusDescription: Text[250];
    begin
        Session.LogMessage('0000CNO', StrSubstNo(BatchSoapRequestMsg, RequestType), Verbosity::Normal, DataClassification::SystemMetadata, TelemetryScope::ExtensionPublisher, 'Category', VATSIITok);

        CertificateEnabled := GetIsolatedCertificate(Cert);

        OnAfterGetIsolatedCertificate(CertificateEnabled, Cert);

        if not CertificateEnabled then begin
            Session.LogMessage('0000CNP', NoCertificateErr, Verbosity::Error, DataClassification::SystemMetadata, TelemetryScope::ExtensionPublisher, 'Category', VATSIITok);
            ProcessBatchResponseCommunicationError(TempSIIHistoryBuffer, NoCertificateErr);
            exit(false);
        end;
.
.
.
[IntegrationEvent(false, false)]
local procedure OnAfterGetIsolatedCertificate(var CertificateEnabled: Boolean; var Cert: DotNet X509Certificate2)
begin
end;

Additional context

Hi team,
It's necessary to implement an event to be able to retrieve the certificate from an Azure Key Vault instead of retrieving it from Isolated Storage.

I asume that my proposal is not posible because of the DotNet, but you can consider splitting the Cert proerties in different variables to be able to update Cert information from AKV.

Thanks in advance

@SngMarioSopena SngMarioSopena changed the title Codeunit 10752 - Procedure InvokeBatchSoapRequest - OnAfterGetIsolatedCertificate [Event Request] Codeunit 10752 - Procedure InvokeBatchSoapRequest - OnAfterGetIsolatedCertificate Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant