Validation Issues with Simplified Invoice Using SDK 3.3.9 on .NET 8

Dear ZATCA Support Team,

I am experiencing validation issues while working with the Simplified Tax Invoice using the latest SDK version (3.3.9) on .NET 8.

The following errors are being encountered during the validation process:

  1. Error:
  • CODE: hashedXml
  • MESSAGE: hashedXml does not match with QR code hashedXml or the hashedXml is missing.
  1. Error:
  • CODE: signatureValue
  • MESSAGE: Wrong signature value.
  1. Error:
  • CODE: invoiceSignedDataDigestValue
  • MESSAGE: Wrong invoice hashing.

Additional Information:

  • The same code and approach work successfully for Standard Tax Invoices without any issues.
  • The problem occurs specifically when validating Simplified Invoices.

Request:

Could you please provide guidance on resolving this issue or confirm if any updates or specific changes are required to handle Simplified Invoices with SDK 3.3.9 on .NET 8?

Thank you for your assistance.
2024-12-22_07-50-36

2 Likes

Hello AhmedGalal,

were you able to solve the issue?

1 Like

السلام عليكم ورحمة الله و بركاته

I faced a similar issue, the solution was to set: PreserveWhiteSpace to true on the xml document before loading the invoice to it from file before signing it

string unSignedInvoicePath = GetFilePath(unSignedInvoiceFile);
XmlDocument xmlInvoice = new XmlDocument();
xmlInvoice.PreserveWhitespace = true;
xmlInvoice.Load(unSignedInvoicePath);

without the third line, I get that same exception.

وعليكم السلام ورحمة الله وبركاته

xmlInvoice.PreserveWhitespace = true;
After trying your suggestion, the issue still persists, and I haven’t been able to resolve it.

Hi Azeem
The issue still hasn’t been resolved despite all attempts, even when using the latest library.