<?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>Newbie Questions</title><link>https://www.infopathdev.com:443/forums/39.aspx</link><description>New to InfoPath? Search to see if your question has already been answered. If it has not, then ask it here or the appropriate topic forum.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Getting info to secondary data source when the dataconnection returns an xml document</title><link>https://www.infopathdev.com:443/forums/thread/45564.aspx</link><pubDate>Thu, 06 Aug 2009 21:21:58 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:45564</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/45564.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=45564</wfw:commentRss><description>&lt;p&gt;Hi Witzer and thanks for the complement,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not sure I understand your scenario exactly, so here&amp;#39;s a few points:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;div&gt;A good Web Service will return the correct WSDL for the data and you won&amp;#39;t have to do any parsing of strings... In other words, you&amp;#39;ll see the XML show up in the data source pane if you select the data connection you added and expand the nodes.&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Sometimes, you need to send it a value so that it will return the correct schema. Use the sample value for that when you create the connection. Make sure the Web Service returns a plural number of rows for repeating data sets so that your form identifies it as repeating. If you don&amp;#39;t have control over the Web Service, this can be a problem.&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;The DC is just the data connection. To get the secondary data you need to select the nodes you want. For example:&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;XPathNavigator sourceTable = domSource.SelectSingleNode(tablesrc);&lt;br /&gt;XPathNavigator sourceRow = sourceTable.SelectSingleNode(rowsrc); &lt;br /&gt;XPathNodeIterator srcNodes = sourceTable.Select(rowsrc, FormHost.NamespaceManager);&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Assuming the DC returns the correct XML structure (not sure about that from what you said), you should take a look at qRules 1.7 (free). It has a CopyTable function that lets you copy nodes from a secondary data source into your main data source. No coding required. &lt;/p&gt;
&lt;p&gt;Cheers&lt;/p&gt;</description></item><item><title>Getting info to secondary data source when the dataconnection returns an xml document</title><link>https://www.infopathdev.com:443/forums/thread/45443.aspx</link><pubDate>Wed, 05 Aug 2009 14:31:10 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:45443</guid><dc:creator>witzer</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/45443.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=45443</wfw:commentRss><description>&lt;p&gt;Let me first say this is a great forum.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Here is the problem I have: when I create the dataconnection it obviously doesn&amp;#39;t create the nodes in the secondary data source that contain the xml document.&amp;nbsp; The secondary data source is uneditable, but I believe I know how to make it edible.&amp;nbsp; Do I need to add to manually add the nodes to the&amp;nbsp;secondary data source in order to map these values&amp;nbsp;to controls&amp;nbsp;bound to nodes to the&amp;nbsp;primary data source or is there an easier better way to do this?&amp;nbsp; I hope this makes sense.&lt;/p&gt;
&lt;p&gt;So when I use code like below it compiles fine, but the dc does not contain any information about the nodes in the XmlDocument that has been returned.&lt;/p&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;
&lt;p&gt;XPathNavigator&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; yo = DataSources[&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;DI_GetDIDoc&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;].CreateNavigator();&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;yo.SelectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;/dfs:myFields/dfs:queryFields/ns2:DI_GetDIDoc/ns2:strSDNum&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager).SetValue(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;140695&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;);&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;DataConnection&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; dc = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;this&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.DataConnections[&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;DI_GetDIDoc&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;];&lt;/p&gt;
&lt;p&gt;dc.Execute();&lt;/p&gt;&lt;/font&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>