# .Net SDK Validate QR Code, \[Error\] CODE: hashedXml, MESSAGE: hashedXml does not match with qr code hashedXml or the hashedXml is missing

**URL:** <https://zatca1.discourse.group/t/net-sdk-validate-qr-code-error-code-hashedxml-message-hashedxml-does-not-match-with-qr-code-hashedxml-or-the-hashedxml-is-missing/3037>\
**Category:** SDK, web-based validator and sandbox\
**Created:** [September 15, 2024, 10:08am UTC](https://zatca1.discourse.group/t/net-sdk-validate-qr-code-error-code-hashedxml-message-hashedxml-does-not-match-with-qr-code-hashedxml-or-the-hashedxml-is-missing/3037 "2024-09-15T10:08:45Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![eCloud](https://dub1.discourse-cdn.com/flex013/user_avatar/zatca1.discourse.group/ecloud/32/629_2.png) [@eCloud](https://zatca1.discourse.group/u/eCloud)\
**Post date:** [September 15, 2024, 3:18pm UTC](https://zatca1.discourse.group/t/net-sdk-validate-qr-code-error-code-hashedxml-message-hashedxml-does-not-match-with-qr-code-hashedxml-or-the-hashedxml-is-missing/3037/9 "2024-09-15T15:18:28Z")

</div>

Dear @suhailkk

Why you need to regenerate QRcode and Hash?  
Its all **done** when Invoice was **successfuly Signed**.

We can get all information, Hash and QRcode inside the SignedXML.

We just need create RequestApi from SignedXML and send as Payload to Fatoora Portal.

Based on code in [this thread](https://zatca1.discourse.group/t/sdk-versions-3-2-6-and-3-3-3/2675/38),  
This sniped code, how you can extract base64QrCode from SignResult

```auto
 //Get Invoice Hash for Next PIH
 var SignedInvoiceHash = GetInvoiceHash(result);
 Console.WriteLine($"Invoice Hash : {SignedInvoiceHash}\n");

 //Get QRCode from SignedInvoice
 var Base64QrCode = GetBase64QrCode(result);
 Console.WriteLine($"Base64 QRCode : {Base64QrCode}\n");

```

```auto
public static string GetInvoiceHash(SignResult signResult)
{
    var step = signResult.Steps
        .FirstOrDefault(s => s.StepName == "Generate EInvoice Hash");
    return step?.ResultedValue ?? "Invoice Hash not found";
}

public static string GetBase64QrCode(SignResult signResult)
{
    XmlDocument xmlDoc = new XmlDocument() { PreserveWhitespace = true };
    xmlDoc.LoadXml(signResult.SignedEInvoice.OuterXml);

    XmlNamespaceManager nsManager = new XmlNamespaceManager(xmlDoc.NameTable);
    nsManager.AddNamespace("cbc", "urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2");
    nsManager.AddNamespace("cac", "urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2");

                // Find the QR code <cbc:EmbeddedDocumentBinaryObject>
    XmlNode qrNode = xmlDoc.SelectSingleNode("//cac:AdditionalDocumentReference[cbc:ID='QR']//cbc:EmbeddedDocumentBinaryObject", nsManager);
    return qrNode.InnerText.ToString();
}

```

 ![{81939E7B-F629-45A8-9E6C-89FC66FB3B6C}](https://europe1.discourse-cdn.com/flex013/uploads/zatca1/original/1X/d9a082275892389f23a8d6a153ad1abab624014f.png)

---

_[View the full topic](https://zatca1.discourse.group/t/net-sdk-validate-qr-code-error-code-hashedxml-message-hashedxml-does-not-match-with-qr-code-hashedxml-or-the-hashedxml-is-missing/3037)._
