any one know what is the problem with dll
when i sign with cmd fatooraNet sign -invoice c:\test\bassam.xml -signedInvoice c:\test\bas.xml
the file pass
I think there is a bug in signing process from dll, There error related to the tag <?xml version="1.0" encoding="UTF-8"?> in first line in the signed xml doc;
All of us pass xml documnet without header <?xml version="1.0" encoding="UTF-8"?> to the sign method, but the result signed xml document has this tag in the first line
From my test, now error or bug on signing process, all step work well, Signed Document Accepted by Compliance Invoice Check, Reporting or Clearance with no any errors or warnings.
The Issue in .Net library is how to use this library to validate Signed Invoice.
Note, this TestXML page can only be used to test Invoices signed using Certificates and Private keys contained in the SDK, this will result in an error if your invoice is signed using another certificate and private key.
The best way is to test invoice directly to the Compliance Check Invoice API or Reporting Api / Clearance Api.
This is my result test of .NET8 library from Zatca.eInvoice.SDK
I. ONBOARDING PROCESS
Step 1
CSR and PrivateKey Generated Successfully
Step 2
GET CCSID Successfully
Step 3
Send Sample Invoice Successfully
Step 4
Get PCSID Successfully
Data has been serialized to the file.
II. APPROVAL PROCESS
1. Get Standard Invoice Approval
Clearance Standard Invoice
{
"requestType": "Invoice Reporting",
"requestUrl": "https://gw-fatoora.zatca.gov.sa/e-invoicing/developer-portal/compliance/invoices",
"statusCode": "200-OK",
"clearanceStatus": "CLEARED",
"validationResults": {
"status": "PASS",
"infoMessages": [
{
"status": "PASS",
"type": "INFO",
"code": "XSD_ZATCA_VALID",
"category": "XSD validation",
"message": "Complied with UBL 2.1 standards in line with ZATCA specifications"
}
],
"warningMessages": [],
"errorMessages": []
},
"clearedInvoice": ".........."
}
Clearance Standard Credit Note
{
"requestType": "Invoice Reporting",
"requestUrl": "https://gw-fatoora.zatca.gov.sa/e-invoicing/developer-portal/compliance/invoices",
"statusCode": "200-OK",
"clearanceStatus": "CLEARED",
"validationResults": {
"status": "PASS",
"infoMessages": [
{
"status": "PASS",
"type": "INFO",
"code": "XSD_ZATCA_VALID",
"category": "XSD validation",
"message": "Complied with UBL 2.1 standards in line with ZATCA specifications"
}
],
"warningMessages": [],
"errorMessages": []
},
"clearedInvoice": ".........."
}
Clearance Standard Debit Note
{
"requestType": "Invoice Reporting",
"requestUrl": "https://gw-fatoora.zatca.gov.sa/e-invoicing/developer-portal/compliance/invoices",
"statusCode": "200-OK",
"clearanceStatus": "CLEARED",
"validationResults": {
"status": "PASS",
"infoMessages": [
{
"status": "PASS",
"type": "INFO",
"code": "XSD_ZATCA_VALID",
"category": "XSD validation",
"message": "Complied with UBL 2.1 standards in line with ZATCA specifications"
}
],
"warningMessages": [],
"errorMessages": []
},
"clearedInvoice": ".........."
}
1. Get Simplified Invoice Approval
Reporting Simplified Invoice
{
"requestType": "Invoice Reporting",
"requestUrl": "https://gw-fatoora.zatca.gov.sa/e-invoicing/developer-portal/compliance/invoices",
"statusCode": "200-OK",
"reportingStatus": "REPORTED",
"validationResults": {
"status": "PASS",
"infoMessages": [
{
"status": "PASS",
"type": "INFO",
"code": "XSD_ZATCA_VALID",
"category": "XSD validation",
"message": "Complied with UBL 2.1 standards in line with ZATCA specifications"
}
],
"warningMessages": [],
"errorMessages": []
}
}
Reporting Simplified Credit Note
{
"requestType": "Invoice Reporting",
"requestUrl": "https://gw-fatoora.zatca.gov.sa/e-invoicing/developer-portal/compliance/invoices",
"statusCode": "200-OK",
"reportingStatus": "REPORTED",
"validationResults": {
"status": "PASS",
"infoMessages": [
{
"status": "PASS",
"type": "INFO",
"code": "XSD_ZATCA_VALID",
"category": "XSD validation",
"message": "Complied with UBL 2.1 standards in line with ZATCA specifications"
}
],
"warningMessages": [],
"errorMessages": []
}
}
Reporting Simplified Debit Note
{
"requestType": "Invoice Reporting",
"requestUrl": "https://gw-fatoora.zatca.gov.sa/e-invoicing/developer-portal/compliance/invoices",
"statusCode": "200-OK",
"reportingStatus": "REPORTED",
"validationResults": {
"status": "PASS",
"infoMessages": [
{
"status": "PASS",
"type": "INFO",
"code": "XSD_ZATCA_VALID",
"category": "XSD validation",
"message": "Complied with UBL 2.1 standards in line with ZATCA specifications"
}
],
"warningMessages": [],
"errorMessages": []
}
}
ALL DONE!
C:\Users\Incredible One\source\repos\ZatcaWithSDK\ZatcaWithSDK\bin\Debug\net8.0\ZatcaWithSDK.exe (process 11512) exited with code 0.
To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops.
Press any key to close this window . . .
I followed the previous steps and I get Signed Invoice correctly, but when I call: new EInvoiceValidator().ValidateEInvoice(xml, certificateContent, pihContent)
I get errors in validating:
Validate EN Schematrons => [Error] occurred in validating Schematrons.
Validate KSA Schematrons => [Error] occurred in validating Schematrons.
Note that ValidateEInvoice() is not used in sample project on Github Repository