<?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>Data Connections</title><link>https://www.infopathdev.com:443/forums/44.aspx</link><description> </description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Extracting data from infopath fields or extracting metadata from .xsn</title><link>https://www.infopathdev.com:443/forums/thread/46078.aspx</link><pubDate>Thu, 20 Aug 2009 07:41:17 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:46078</guid><dc:creator>Qazi Anis</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/46078.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=44&amp;PostID=46078</wfw:commentRss><description>&lt;p&gt;hello Martinas, &lt;/p&gt;
&lt;p&gt;well you can encrypt the data in the infopath form before saving or submiting it &lt;/p&gt;
&lt;p&gt;below is the code to encrypt a field in InfoPath 2007. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Rijndael rKey = new RijndaelManaged();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XPathNavigator xnFormName = null;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XPathNavigator totalNode = this.MainDataSource.CreateNavigator();&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xnFormName = totalNode.SelectSingleNode(&amp;quot;/my:myFields/my:field1&amp;quot;, this.NamespaceManager);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string totalNodeOriginal = xnFormName.ToString();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; byte[] totalInfo =&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Text.Encoding.Unicode.GetBytes(xnFormName.ToString());&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MemoryStream ms = new MemoryStream();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CryptoStream csBase64 = new CryptoStream(ms,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new ToBase64Transform(), CryptoStreamMode.Write);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CryptoStream csRijndael = new CryptoStream(csBase64,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rKey.CreateEncryptor(), CryptoStreamMode.Write);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; csRijndael.Write(totalInfo, 0, (int)totalInfo.Length);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; csRijndael.FlushFinalBlock();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string base64enc = System.Text.Encoding.ASCII.GetString&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (ms.GetBuffer(), 0, (int)ms.Length);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xnFormName.SetValue(base64enc);&lt;/p&gt;
&lt;p&gt;hope this solves your problem&lt;/p&gt;</description></item><item><title>Re: Extracting data from infopath fields or extracting metadata from .xsn</title><link>https://www.infopathdev.com:443/forums/thread/44893.aspx</link><pubDate>Fri, 24 Jul 2009 06:31:45 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:44893</guid><dc:creator>martinas</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/44893.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=44&amp;PostID=44893</wfw:commentRss><description>&lt;p&gt;Hello Craig,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Thx for your answer. &lt;/p&gt;
&lt;p&gt;Not sure if I was clear enough, because &amp;nbsp;I need a way to grab the data before they are stored in any way. They way I understad your code you fetch the data from the .xml file that the data is stored in after the form has been submitted?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Extracting data from infopath fields or extracting metadata from .xsn</title><link>https://www.infopathdev.com:443/forums/thread/44843.aspx</link><pubDate>Thu, 23 Jul 2009 15:32:58 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:44843</guid><dc:creator>CraigW</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/44843.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=44&amp;PostID=44843</wfw:commentRss><description>&lt;p&gt;Hi Martin,&lt;/p&gt;
&lt;p&gt;I can&amp;#39;t comment on the encryption part, but it&amp;#39;s certainly possible to access the form data from within SharePoint.&lt;/p&gt;
&lt;p&gt;For your submitted forms, the SPListItem.File object gives you access to the actual XML form that holds the data.&lt;/p&gt;
&lt;p&gt;The easiest way to use is is to save your .xsn as source, then use xsd.exe to create a class from it.&amp;nbsp; You can then deserialise the XML in code to an instance of your class...&lt;/p&gt;
&lt;p&gt;E.g., Use xsd.exe&amp;nbsp;/c to create a class called myForm, then use the following code in SharePoint to get the data from a listitem called listItem:&lt;/p&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;
&lt;p&gt;XmlSerializer&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; serialiser = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;XmlSerializer&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;typeof&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;(&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;myForm&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;));&lt;br /&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;using&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; (System.IO.&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;StreamReader&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; reader = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; System.IO.&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;StreamReader&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;(listItem.File.OpenBinaryStream()))&lt;br /&gt;{&lt;br /&gt;&lt;font color="#2b91af"&gt;myForm&lt;/font&gt;&lt;font size="2"&gt;&amp;nbsp;formData&lt;/font&gt;&amp;nbsp;= (&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;myForm&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;)serialiser.Deserialize(reader);&lt;br /&gt;}&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;You can then access the data with formData.SomeElement, etc.&amp;nbsp; xsd.exe is available at the Visual Studio command prompt.&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;Craig&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Extracting data from infopath fields or extracting metadata from .xsn</title><link>https://www.infopathdev.com:443/forums/thread/44459.aspx</link><pubDate>Thu, 16 Jul 2009 13:04:29 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:44459</guid><dc:creator>martinas</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/44459.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=44&amp;PostID=44459</wfw:commentRss><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;I&amp;#39;m looking into infopath functionallity looking to use it in a system with MS form server and sharepoint, a viewer is also used to show the form on a webpage, my problem is that I would like to&amp;nbsp; encrypt som of the data before sending the form. &lt;br /&gt;Reading information and trying to understand how this setup will work I&amp;#39;ve looked into two different solutions. I hope mabey you can give me some help and direction if this is possible.&lt;/p&gt;
&lt;p&gt;As I&amp;#39;ve understood there is no way to encryption module in infopath. Possible solutions here could be to:&lt;/p&gt;
&lt;p&gt;1) take the data from the fields locally, encrypt the data and put them back in the form to send the data to the database.&lt;br /&gt;2) Take the data from the fields locally, encrypt the data and send them trought another channel to the database where I store the final data. &lt;/p&gt;
&lt;p&gt;Are any of these viable at all?&lt;/p&gt;
&lt;p&gt;Mabey this other question is kind of offtopic but still wondering and mabey you can help me or guide me in the right direction.&lt;br /&gt;Is it possible to extract the question data and the metadata for a question &amp;amp; answering field from the .xsn file and be able to interpet this in any other program then form server? Would also then be interested in extracting some cind of validation rules also.&lt;br /&gt;Thinking about making some code of my own to handle the fields that I want to be encrypted, but then I guess I need to be able to mark the fields in a specific way. Is there support for marking fields in such a way and to extract the information&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Thx in advance for any help. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>