<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>General</title><link>https://www.infopathdev.com:443/forums/41.aspx</link><description>If you're not sure where to ask your question, ask it here. If necessary, our moderators will make sure it gets classified in the correct board.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Need help with SignedDataBlocks[int].Sign()</title><link>https://www.infopathdev.com:443/forums/thread/49756.aspx</link><pubDate>Mon, 07 Dec 2009 12:35:22 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:49756</guid><dc:creator>Sarper</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/49756.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=49756</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I usually don&amp;#39;t ask about problems on forums, I prefer to search and find the solution myself, however I&amp;#39;ve been looking for a solution to this particular problem for months and haven&amp;#39;t found a single entry about it anywhere yet.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Problem Description:&lt;/strong&gt;&lt;/p&gt;I have a form template to request something which require approvals from 4-5 people in different steps.&lt;br /&gt;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:&lt;br /&gt;&lt;font size="2"&gt;SignedDataBlocks[0].Sign();&lt;br /&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;br /&gt;For most of the users this works fine, I&amp;#39;ve tested it for dozens of times and it works fine.&lt;br /&gt;But for a little amount of users it gives the error message below.&lt;br /&gt;&lt;br /&gt;&lt;span style="COLOR:#1f497d;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;Invalid Context: XmlDocument is read-only.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;span style="COLOR:#1f497d;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&amp;nbsp;&amp;nbsp; at Microsoft.Office.InfoPath.Internal.SignedDataBlockHost.Sign()&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR:#1f497d;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&amp;nbsp;&amp;nbsp; at ContingentTemplate.FormCode.SaveButton_Clicked(Object sender, ClickedEventArgs e)&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR:#1f497d;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&amp;nbsp;&amp;nbsp; at Microsoft.Office.InfoPath.Internal.ButtonEventHost.OnButtonClick(DocActionEvent pEvent)&lt;/font&gt;&lt;/font&gt;&lt;/span&gt; 
&lt;p style="MARGIN:0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="COLOR:#1f497d;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&amp;nbsp;&amp;nbsp; at Microsoft.Office.Interop.InfoPath.SemiTrust._ButtonEventSink_SinkHelper.OnClick(DocActionEvent pEvent)&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;br /&gt;- I am %100 percent sure that the form is not opened as read-only. (I&amp;#39;ve&amp;nbsp;even tried to sign&amp;nbsp;read-only forms and it works!, it doesn&amp;#39;t throw this exception if the form is read-only)&lt;br /&gt;- I&amp;#39;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&amp;#39;t sign a specific form from that form template.&lt;br /&gt;&lt;br /&gt;I&amp;#39;ve used similar code to develop many InfoPath form based processes and this problem sometimes occur in all of them. I&amp;#39;m surprized that there is not even 1 result when I search the error message&amp;nbsp;in google, I&amp;#39;m sure many people use SignedDataBlocks[int].Sign() function&amp;nbsp;instead of &amp;quot;Click here to sign this section&amp;quot; text (I hide them from view.xsl), and I am not even sure if the error occurs because&amp;nbsp;I use&amp;nbsp;C# code instead of the normal&amp;nbsp;&amp;quot;Click here to sign this section&amp;quot; text way.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;I am open to any suggestions, ideas but I&amp;nbsp;don&amp;#39;t have much time to test it. One person&amp;nbsp;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.&amp;nbsp;&lt;font size="2"&gt;&lt;/p&gt;&lt;/font&gt;</description></item></channel></rss>