<?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>Web Services</title><link>https://www.infopathdev.com:443/forums/48.aspx</link><description> </description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Data from WCF is not shown</title><link>https://www.infopathdev.com:443/forums/thread/91447.aspx</link><pubDate>Wed, 17 Jul 2013 04:14:57 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:91447</guid><dc:creator>IPDeveloper</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/91447.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=48&amp;PostID=91447</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Hello everybody! I&amp;#39;m desperate and need assistance. I have InfoPath 2007 form with JS code behind. Also I have a WCF service. Here&amp;#39;s a JS code in XDocument::OnLoad(eventObj) function to fill in drop down list with data.&lt;br /&gt;&lt;/p&gt;

&lt;pre&gt;var formName = &amp;#39;RegistrationForm&amp;#39;;
var code = XDocument.DOM.selectSingleNode(&amp;#39;/Root/@code&amp;#39;).text;
var version = XDocument.DOM.selectSingleNode(&amp;#39;/Root/@ver&amp;#39;).text;
try
{
	var ws = XDocument.DataObjects(&amp;#39;GetReference&amp;#39;);
	ws.DOM.setProperty(&amp;quot;SelectionNamespaces&amp;quot;, &amp;quot;xmlns:dfs=\&amp;quot;http://schemas.microsoft.com/office/infopath/2003/dataFormSolution\&amp;quot; xmlns:ns12=\&amp;quot;http://tempuri.org/\&amp;quot;&amp;quot;);	
	ws.DOM.selectSingleNode(&amp;quot;/dfs:myFields/dfs:queryFields/ns12:GetReference/ns12:processCode&amp;quot;).text = code;
	ws.DOM.selectSingleNode(&amp;quot;/dfs:myFields/dfs:queryFields/ns12:GetReference/ns12:processVersion&amp;quot;).text = version;
	ws.DOM.selectSingleNode(&amp;quot;/dfs:myFields/dfs:queryFields/ns12:GetReference/ns12:formCode&amp;quot;).text = formName;
	ws.Query();
	XDocument.UI.Alert(&amp;#39;Data loaded: &amp;#39; + ws.DOM.xml);
}
catch(err)
{
	XDocument.UI.Alert(&amp;#39;Oops, something went wrong. Contact developers.&amp;#39;);
	XDocument.View.Window.Close(true);
}&lt;/pre&gt;
&lt;p&gt;The problem is that drop down list is empty. But an alert after ws.Query() displays correct XML with data. Also via Fiddler I can see that request was successful and data was loaded. &lt;br /&gt;
What can be a reason for such a strange behavoir? &lt;/p&gt;</description></item></channel></rss>