“errorMessages”: [
{
“type”: “ERROR”,
“code”: “signed-properties-hashing”,
“category”: “CERTIFICATE_ERRORS”,
“message”: “Invalid signed properties hashing, SignedProperties with id=‘xadesSignedProperties’”,
“status”: “ERROR”
}
]
Dear @Mohee_b
Thanks for reaching out, Welcome to our community.
To provide comprehensive support as usual, can I kindly ask you to share the exact steps that you are following?
Additionally, please note that there are no need to sign the B2B invoices as they will be signed by ZATCA and return the signed invoice in the API response the signing process mandatory for B2C invoices using your certificate, Please find the below SigningProcessUpdated.pdf ensure that you are following the same mentioned steps.
SigningProcessUpdated.pdf (927.7 KB)
Thanks,
Ibrahem Daoud.
I solved the problem, the reason for the solution was that when I load the XML I used this function
internal XmlDocument LoadXML(string filePath)
{
try
{
**XmlReaderSettings xsdReaderSettings = XmlSettingsProvider.GetStandardXsdReaderSettings();**
** XmlDocument xmlDocument = new XmlDocument()**
** {**
** PreserveWhitespace = true**
** };**
** using (FileStream input = File.OpenRead(filePath))**
** {**
** using (XmlReader reader = XmlReader.Create((Stream)input, xsdReaderSettings))**
** xmlDocument.Load(reader);**
** }**
return xmlDocument;
}
catch (XmlException ex)
{
int lineNumber = ex.LineNumber;
int linePosition = ex.LinePosition;
string[] strArray = File.ReadAllLines(filePath);
string message = "[SAX] ";
if (ex.Message.StartsWith("Name cannot begin with the ':'"))
{
Match match = Regex.Match(strArray[lineNumber - 1], "<([^>\\s]+)");
if (match.Success)
{
string str = match.Groups[1].Value;
Console.WriteLine("Tag Name: " + str);
message = message + "Element type \"" + str + "\" must be terminated by the matching end-tag \"\".";
}
}
else if (ex.Message.StartsWith("The prefix"))
{
Match match = Regex.Match(ex.Message, "'([^']*)'\\s+for\\s+element\\s+'([^']*)'");
if (match.Success && match.Groups.Count == 3)
{
string str1 = match.Groups[1].Value;
string str2 = match.Groups[2].Value;
message = message + "The prefix \"" + str1 + "\" for element \"" + str2 + "\" is not bound.";
}
else
message += ex.Message;
}
else if (ex.Message.StartsWith("'<' is an unexpected token"))
{
string str = Regex.Match(strArray[lineNumber - 2], "<([^>\\s]+)").Groups[1].Value;
Console.WriteLine("Tag Name: " + str);
message = message + "The end-tag for element type \"" + str + "\" must end with a '>' ";
}
else if (ex.Message.StartsWith("Name cannot begin"))
{
Match match = Regex.Match(strArray[lineNumber - 2], "<([^>\\s]+)");
if (match.Success)
{
string str = match.Groups[1].Value;
Console.WriteLine("Tag Name: " + str);
message = message + "Element type \"" + str + "\" must be followed by either attribute specifications, '>' or '/>'.";
}
else
message += "Unable to extract tag name.";
}
else
{
string str = Regex.Match(strArray[lineNumber - 1], "<([^>\\s]+)").Groups[1].Value;
message = message + "Issue occurred at tag \"" + str + "\" ;" + ex.Message + " ";
}
throw new Exception(message);
}
}
Using ZATCA SDK .NET V3.3.3 first I generated CSR and PrivatKey then I sent CSR and OTP to SANDBOX endpoint to get Binary Security token and secret and I decoded Binary Security token BASE64 to get CCSID and I signed simplified invoices using CCSID and PrivatKey and sent it to endpoint to get PCSID and the response was Pass & REPORTED then I requested PCSID by sharing RequestID and got it by decoding Binary Security token to get PCSID then I created new simplified invoice and signed it using SDK with PCSID and PrivatKey and I checked it using SDK and the previous error appeared
وهل هذا يعني ان نقوم بارسال الفواتير القياسية بدون ان نقوم بتوقيعها؟
Dear @Mohee_b
Thanks for reaching out,
Kindly ensure to install the latest version for SDK as its now 3.3.9 to keep updated with all business rules enhancements.
Thanks,
Ibrahem Daoud.
عزيزي @Mohee_b
شكرا لتواصلك, كما تم الذكر سابقا فإن عملية التوقيع ليست ضرورية للفواتير القياسية (B2B)
وأنما هي إجبارية فقط للفواتير المبسطة (B2C).
شكرا,
إبراهيم داوود.