Need clarification about Schematron Validation

Here I am trying to use .Net SDK 8 at first time. Now all signDocument validations are passed except Schematron Validation both KSA and EN.

Is there any manual method for validating Schematron otherwise we can build api in java for validating xml and get result in c# code for further.

Please guide someone has clarification.

Dear @jasimsa

Thanks for reaching out, welcome to our community.

To ensure comprehensive support as usual, Can I kindly ask you what the SDK version that you are using?

Additionally, can you provide the exact errors for Schematron Validation that you are receiving?

Thanks,
Ibrahem Daoud.

@idaoud Thanks for your timely response.

Currently I am using 3.3.6 Last week I downloaded from Sandbox.

SignDocument is valid :

I get validation error in KSA and EN schematron

This is understandable for you otherwise I will explain more.

Dear @jasimsa

Can I kindly ask you to download the latest version for SDK 3.3.7 Zatca

and try it again, let me know if it will work fine.

Thanks,
Ibrahem Daoud.

Sorry, Same response when I tried SDK 3.3.7 also.
I am not tried Simulation SDK version.

What is your suggestion to use?

Do you have any checklist to validate my implementation steps are correct or not ?

Many Thanks .

I validate generated Invoice after signDocument process

Note : I am using net8.0 with Test Folder files.

Dear @jasimsa

Please note that the warning message you receiving is related to supply date, Kindly find the attached (20230519_ZATCA_Electronic_Invoice_XML_Implementation_Standard_ vF.pdf) for the list of warnings and errors and how to fix it in your XML.

Additionally, the warning message (through APIs) it means that the invoice has been submitted successfully to ZATCA, Just ensure to fix the warning in the further invoices, However, the errors means that the invoice has not been submitted successfully, you need to fix the error and submit the fixed invoice through the API.

I hope it’s clear enough now, If you faced any concerns, please do not hesitate to reach out our support team via the below mail to ensure comprehensive support as usual.

SP support mail: sp_support@zatca.gov.sa

20230519_ZATCA_Electronic_Invoice_XML_Implementation_Standard_ vF.pdf (1.0 MB)

Thanks,
Ibrahem Daoud.

Thanks for your support.

But I have problem with

ValidateENSchematronMiddleware
ValidateKSASchematronMiddleware

Above mentioned result I get xml data after signDocument from SDK I manually create XML file with document without calling ValidateEInvoice(inv,cer,phi).

In my understanding we need to validate schematron before posting to Zatca.

I am developing ASP.Net Core Web API with Core 8.0.

I don’t know the problem Saxon.Api or IKVM maybe it doesn’t support to validate xml schematron.

Your support good and is very needful.

The following 2 issues are still remaing.

Dear @jasimsa

There was a known issue with the SDK 3.3.6 DLL and it was resolved in SDK 3.3.7 try to import the right DLL from SDK 3.3.7 in your solution, after that try to sign and validate your XML.

If this is solution does not work, Kindly share all your concerns via the above SP mail, to schedule meeting if needed.

Thanks,
Ibrahem Daoud.

Thanks for your support.

I will check and let you know.

Dear Mr. @idaoud

Before I posted query regarding issue related to Schematron Validation.
I tried many ways with latest version of SDK 3.3.7 also getting same error as I mentioned before.

Alhamdhulillaah, Yesterday I found one problem with your SDK DLL folder.

See the below screenshot the IKVM.Runtime.dll is not latest on

I found one latest DLL from runtime folder of you SDK

I import this latest DLL into my project both KSA and EN validation are successfully validated.

Thanks for your continues support.

If I faced any issues I will let you know in upcoming posts.

1 Like

@jasimsa

Really great catch, thanks for sharing.

Initialization Step (Simplified EInvoice) : True
Validate XSD : True
Validate EN Schematrons : True
Validate KSA Schematrons : True
Generate EInvoice Hash : True
Parse Certificate : True
Generate EInvoice QR : True
Validate QR Code : True
Validate EInvoice Signature : True
Validate EInvoice PIH : True

Overall Signed Invoice Validation : True!
Reporting Simplified Debit Note

{
  "requestType": "Reporting",
  "requestUrl": "https://gw-fatoora.zatca.gov.sa/e-invoicing/developer-portal/invoices/reporting/single",
  "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": []
  }
}



Onboarding Info Data has been serialized to the file.



ALL DONE!

Dear @eCloud,

Alhamdhulillah

I successfully integrated and tested developer SDK 3.3.7. Thanks for your support but till I am not tested simulation and production APIs.

But I am facing one problem I will explain below.

for example :

In the development stage the folder structure of ‘Data directory’ for validation rules as below path

Project Folder\Data\Rules\schematrons\KSA and CEN Files.xsl

Its working when we run while debugging because the below screenshot from Zatca.EInvoice.SDK.Utilities.ConfigurationManager class

every time system check Data directory it goes 3 parent directories back from application running location Project Folder\bin\Debug\net8.0

…\…\…\Data

In my case it’s running because the below locations

Application running location : Project Folder\bin\Debug\net8.0\
Data Directory location : Project Folder\Data\

In other hand the problem is while deploying this application in IIS Server
I need to create 3 sub directories before Published Location and place that Data directory on 3 parents directories from Published Location.

My published location
SmartEFatoorah\zatca\publish\SDK3.3.7\

Data Directory location
SmartEFatoorah\Data

My concern is I am unable to maintain below directory structure in cloud environment.

image

My suggestion is we just remove this directory structure from Zatca.EInvoice.SDK.Utilities.ConfigurationManager

remove => …\…\…\Data\Rules\

change => .\Data\Rules\

If you have any suggestions please let me know.

Many Thanks,
Mohamed Jasim .B

Relative Path issue is the next issue in Zatca.eInvoice.SDK library, I think Zatca Developers should see this as an important issue. I choose not to use Zatca.eInvoice.SDK library in my Web App project because of this issue.

Yes patching the dll file is the only easiest way to do :frowning:

1 Like

Dear @idaoud,

I think you are from ZATCA Support team.
Please consider my issues.

Thanks for your continues support.

1 Like

Dear @jasimsa

Thanks for reaching out,

Can I kindly ask you to share your full concerns through SP supoort mail mentioned previously in this post, to provide comprehensive support as usual and schedule meeting if needed.

Thanks,
Ibrahme Daoud.

Hello @jasimsa, I upgraded to latest sdk, 3.3.9, and I am facing the same error but not resolved with solution, can you help please?

1 Like

Dear @hassanayoub85

Thanks for reaching out, Welcome to our community.

Is there anything I can support you with? If yes, can I kindly ask you to share your full concerns to provide comprehensive support as usual.

Thanks,
Ibrahem Daoud.

Hello @idaoud, thank you.
We upgraded from 3.3.3 to 3.3.9.
We are using
Net 8 and we get this error while validating.
Note: on fatooranet.exe and sandbox the validation is ok.

Dear @hassanayoub85

1- Are you using our SDK tool?
2- What are the exact steps you followed?

Thanks,
Ibrahem Daoud.