Need help with SignedDataBlocks[int].Sign() - InfoPath Dev

InfoPath Dev

Use our Google Custom Search for best site search results.

Need help with SignedDataBlocks[int].Sign()

Last post 12-07-2009 04:35 AM by Sarper. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 12-07-2009 04:35 AM

    • Sarper
    • Not Ranked
    • Joined on 12-07-2009
    • Posts 1

    Need help with SignedDataBlocks[int].Sign()


    I usually don't ask about problems on forums, I prefer to search and find the solution myself, however I've been looking for a solution to this particular problem for months and haven't found a single entry about it anywhere yet.

    Problem Description:

    I have a form template to request something which require approvals from 4-5 people in different steps.
    I have a different section for each approval and each section has a Digital Signature in it. For each section to be signed I use this line of code in a Button_Clicked event handler to get it signed:

    For most of the users this works fine, I've tested it for dozens of times and it works fine.
    But for a little amount of users it gives the error message below.

    Invalid Context: XmlDocument is read-only.
       at Microsoft.Office.InfoPath.Internal.SignedDataBlockHost.Sign()   at ContingentTemplate.FormCode.SaveButton_Clicked(Object sender, ClickedEventArgs e)   at Microsoft.Office.InfoPath.Internal.ButtonEventHost.OnButtonClick(DocActionEvent pEvent)

       at Microsoft.Office.Interop.InfoPath.SemiTrust._ButtonEventSink_SinkHelper.OnClick(DocActionEvent pEvent)

    - I am %100 percent sure that the form is not opened as read-only. (I've even tried to sign read-only forms and it works!, it doesn't throw this exception if the form is read-only)
    - I've seen many different occurance of this error, sometimes a person can never sign their section in any of the forms that share the same form template, Sometimes the problem occurs only for a single form, the user can sign other forms that share the same form template, but can't sign a specific form from that form template.

    I've used similar code to develop many InfoPath form based processes and this problem sometimes occur in all of them. I'm surprized that there is not even 1 result when I search the error message in google, I'm sure many people use SignedDataBlocks[int].Sign() function instead of "Click here to sign this section" text (I hide them from view.xsl), and I am not even sure if the error occurs because I use C# code instead of the normal "Click here to sign this section" text way.

    I am open to any suggestions, ideas but I don't have much time to test it. One person experienced this problem 2 hours ago, and I have only 1 shot to test it, then I will have to approve on his behalf to get things going. 

Page 1 of 1 (1 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.