<?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>Re: Web service with an input param via code - Solved</title><link>https://www.infopathdev.com:443/forums/thread/6373.aspx</link><pubDate>Tue, 31 May 2005 17:52:57 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:6373</guid><dc:creator>smcnary</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/6373.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=6373</wfw:commentRss><description>Thanks for this solution! Is there any way you can convert this code to VB.NET? Thanks, Sarah&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote id="quote"&gt;&lt;font size="1" face="Verdana, Arial, Helvetica" id="quote"&gt;quote:&lt;hr height="1" noshade id="quote"&gt;&lt;i&gt;Originally posted by smcnary&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote id="quote"&gt;&lt;font size="1" face="Verdana, Arial, Helvetica" id="quote"&gt;quote:&lt;hr height="1" noshade id="quote"&gt;&lt;i&gt;Originally posted by CodeWzrd&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;A user selects the the customer id from the drop down list box.  I take the ID and want to pass it to a web service method programmatically.  I tried to store the ID in the data source's XML as a text value but I keep getting an error:&lt;i&gt;"Reference to undeclared namespace prefix: 'dfs'"&lt;/i&gt;.&lt;br /&gt;&lt;br /&gt;Here is the code that I have so far:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;[InfoPathEventHandler(MatchPath="/my:myFields/my:field1", EventType=InfoPathEventType.OnAfterChange)]&lt;br /&gt;public void field1_OnAfterChange(DataDOMEvent e)&lt;br /&gt;{&lt;br /&gt;	// Write code here to restore the global state.&lt;br /&gt;	if (e.IsUndoRedo)&lt;br /&gt;	{&lt;br /&gt;		// An undo or redo operation has occurred and the DOM is read-only.&lt;br /&gt;		return;&lt;br /&gt;	}&lt;br /&gt;&lt;br /&gt;	// A field change has occurred and the DOM is writable. Write code here to respond&lt;br /&gt;	// to the changes.&lt;br /&gt;&lt;br /&gt;	DataObject objDO = null;&lt;br /&gt;	objDO = thisXDocument.DataObjects["GetPIDs"];&lt;br /&gt;&lt;br /&gt;	IXMLDOMNode QueryInput = objDO.DOM.selectSingleNode("/dfs:myFields/dfs:queryFields/s0:GetPIDs/s0:nRID" );  &lt;br /&gt;	IXMLDOMNode RidNode = thisXDocument.DOM.selectSingleNode("/my:myFields/my:field1");&lt;br /&gt;&lt;br /&gt;	QueryInput.text = RidNode.text;&lt;br /&gt;	objDO.Query();&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;It's failing on the QueryInput = objDO.DOM.selectSingleNode line.  I've read that you may have to set the Namespace before I can select a node, by using the setProperty property of the DOM.  But there is no such property.&lt;br /&gt;&lt;br /&gt;Any code example or ideas would be greatly appreciated.&lt;br /&gt;&lt;hr height="1" noshade id="quote"&gt;&lt;/font id="quote"&gt;&lt;/blockquote id="quote"&gt;&lt;br /&gt;&lt;hr height="1" noshade id="quote"&gt;&lt;/font id="quote"&gt;&lt;/blockquote id="quote"&gt;</description></item><item><title>Re: Web service with an input param via code - Solved</title><link>https://www.infopathdev.com:443/forums/thread/6372.aspx</link><pubDate>Tue, 31 May 2005 17:51:49 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:6372</guid><dc:creator>smcnary</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/6372.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=6372</wfw:commentRss><description>&lt;blockquote id="quote"&gt;&lt;font size="1" face="Verdana, Arial, Helvetica" id="quote"&gt;quote:&lt;hr height="1" noshade id="quote"&gt;&lt;i&gt;Originally posted by CodeWzrd&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;A user selects the the customer id from the drop down list box.  I take the ID and want to pass it to a web service method programmatically.  I tried to store the ID in the data source's XML as a text value but I keep getting an error:&lt;i&gt;"Reference to undeclared namespace prefix: 'dfs'"&lt;/i&gt;.&lt;br /&gt;&lt;br /&gt;Here is the code that I have so far:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;[InfoPathEventHandler(MatchPath="/my:myFields/my:field1", EventType=InfoPathEventType.OnAfterChange)]&lt;br /&gt;public void field1_OnAfterChange(DataDOMEvent e)&lt;br /&gt;{&lt;br /&gt;	// Write code here to restore the global state.&lt;br /&gt;	if (e.IsUndoRedo)&lt;br /&gt;	{&lt;br /&gt;		// An undo or redo operation has occurred and the DOM is read-only.&lt;br /&gt;		return;&lt;br /&gt;	}&lt;br /&gt;&lt;br /&gt;	// A field change has occurred and the DOM is writable. Write code here to respond&lt;br /&gt;	// to the changes.&lt;br /&gt;&lt;br /&gt;	DataObject objDO = null;&lt;br /&gt;	objDO = thisXDocument.DataObjects["GetPIDs"];&lt;br /&gt;&lt;br /&gt;	IXMLDOMNode QueryInput = objDO.DOM.selectSingleNode("/dfs:myFields/dfs:queryFields/s0:GetPIDs/s0:nRID" );  &lt;br /&gt;	IXMLDOMNode RidNode = thisXDocument.DOM.selectSingleNode("/my:myFields/my:field1");&lt;br /&gt;&lt;br /&gt;	QueryInput.text = RidNode.text;&lt;br /&gt;	objDO.Query();&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;It's failing on the QueryInput = objDO.DOM.selectSingleNode line.  I've read that you may have to set the Namespace before I can select a node, by using the setProperty property of the DOM.  But there is no such property.&lt;br /&gt;&lt;br /&gt;Any code example or ideas would be greatly appreciated.&lt;br /&gt;&lt;hr height="1" noshade id="quote"&gt;&lt;/font id="quote"&gt;&lt;/blockquote id="quote"&gt;</description></item><item><title>Re: Web service with an input param via code - Solved</title><link>https://www.infopathdev.com:443/forums/thread/6371.aspx</link><pubDate>Tue, 31 May 2005 17:49:38 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:6371</guid><dc:creator>smcnary</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/6371.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=6371</wfw:commentRss><description>Thanks for this solution! Is there any way to convert this code to VB.NET? Thanks! Sarah</description></item><item><title>Re: Web service with an input param via code - Solved</title><link>https://www.infopathdev.com:443/forums/thread/6370.aspx</link><pubDate>Fri, 19 Nov 2004 17:32:36 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:6370</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/6370.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=6370</wfw:commentRss><description>It doesn't hurt to have extra namespaces set that you are not using. Your solution is rather elegant provided that there are not additional namespaces to account for in the other DOM.&lt;br /&gt;&lt;br /&gt;Greg Collins [InfoPath MVP]</description></item><item><title>Re: Web service with an input param via code - Solved</title><link>https://www.infopathdev.com:443/forums/thread/6369.aspx</link><pubDate>Fri, 19 Nov 2004 08:57:53 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:6369</guid><dc:creator>jonbrave</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/6369.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=6369</wfw:commentRss><description>Sorry, I should have posted earlier as I know you have to set the SelectionNamespaces for any &amp; all secondary DOMs before XPath querying.  That's all this is.  This should probably be pointed to anyone using multi-DOMs, as I've seen questions to this effect elsewhere.&lt;br /&gt;&lt;br /&gt;I have one question.  I do not use managed code or "IXMLDOMDocument3", I'm just using MS Script.  Since I'm lazy, and I find all the selection namespaces abstruse, I just set my secondaries to whatever my primary is set to, viz:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;XDocument.GetDOM("Secondary").setProperty("SelectionNamespaces",&lt;br /&gt;  XDocument.DOM.getProperty("SelectionNamespaces"));&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Is this OK or wicked?  Does it do any harm?</description></item><item><title>Re: Web service with an input param via code - Solved</title><link>https://www.infopathdev.com:443/forums/thread/6368.aspx</link><pubDate>Thu, 18 Nov 2004 21:23:14 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:6368</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/6368.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=6368</wfw:commentRss><description>Thanx for sharing the solution with us!&lt;br /&gt;&lt;br /&gt;Greg Collins [InfoPath MVP]</description></item><item><title>Re: Web service with an input param via code - Solved</title><link>https://www.infopathdev.com:443/forums/thread/6367.aspx</link><pubDate>Thu, 18 Nov 2004 20:45:14 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:6367</guid><dc:creator>CodeWzrd</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/6367.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=6367</wfw:commentRss><description>Never mind again.  Figured it out.  After oh 4 hours of researching.&lt;br /&gt;&lt;br /&gt;It turns out that I should have been using IXMLDOMDocument3.  No documentation that I've read so far says I should use the new interface.&lt;br /&gt;&lt;br /&gt;Anyway doing the following will work:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;[InfoPathEventHandler(MatchPath="/my:myFields/my:field1", EventType=InfoPathEventType.OnAfterChange)]&lt;br /&gt;public void field1_OnAfterChange(DataDOMEvent e)&lt;br /&gt;{&lt;br /&gt;	// Write code here to restore the global state.&lt;br /&gt;	if (e.IsUndoRedo)&lt;br /&gt;	{&lt;br /&gt;		// An undo or redo operation has occurred and the DOM is read-only.&lt;br /&gt;		return;&lt;br /&gt;	}&lt;br /&gt;&lt;br /&gt;	// A field change has occurred and the DOM is writable. Write code here to respond&lt;br /&gt;	// to the changes.&lt;br /&gt;&lt;br /&gt;	DataObject objDO = null;&lt;br /&gt;	objDO = thisXDocument.DataObjects["GetPIDs"];&lt;br /&gt;&lt;br /&gt;	IXMLDOMDocument3 domXML = (IXMLDOMDocument3) objDO.DOM;&lt;br /&gt;	domXML.setProperty( "SelectionNamespaces", "xmlns:dfs=\"http://schemas.microsoft.com/office/infopath/2003/dataFormSolution\" " + "xmlns:tns=\"http://tempuri.org/\"");&lt;br /&gt;	IXMLDOMNode QueryInput = objDO.DOM.selectSingleNode("/dfs:myFields/dfs:queryFields/tns:GetPIDs/s0:nRID" );  &lt;br /&gt;	IXMLDOMNode RidNode = thisXDocument.DOM.selectSingleNode("/my:myFields/my:field1");&lt;br /&gt;&lt;br /&gt;	QueryInput.text = RidNode.text;&lt;br /&gt;	objDO.Query();&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;</description></item><item><title>Web service with an input param via code - Solved</title><link>https://www.infopathdev.com:443/forums/thread/4508.aspx</link><pubDate>Thu, 18 Nov 2004 15:10:45 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:4508</guid><dc:creator>CodeWzrd</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/4508.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=4508</wfw:commentRss><description>A user selects the the customer id from the drop down list box.  I take the ID and want to pass it to a web service method programmatically.  I tried to store the ID in the data source's XML as a text value but I keep getting an error:&lt;i&gt;"Reference to undeclared namespace prefix: 'dfs'"&lt;/i&gt;.&lt;br /&gt;&lt;br /&gt;Here is the code that I have so far:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;[InfoPathEventHandler(MatchPath="/my:myFields/my:field1", EventType=InfoPathEventType.OnAfterChange)]&lt;br /&gt;public void field1_OnAfterChange(DataDOMEvent e)&lt;br /&gt;{&lt;br /&gt;	// Write code here to restore the global state.&lt;br /&gt;	if (e.IsUndoRedo)&lt;br /&gt;	{&lt;br /&gt;		// An undo or redo operation has occurred and the DOM is read-only.&lt;br /&gt;		return;&lt;br /&gt;	}&lt;br /&gt;&lt;br /&gt;	// A field change has occurred and the DOM is writable. Write code here to respond&lt;br /&gt;	// to the changes.&lt;br /&gt;&lt;br /&gt;	DataObject objDO = null;&lt;br /&gt;	objDO = thisXDocument.DataObjects["GetPIDs"];&lt;br /&gt;&lt;br /&gt;	IXMLDOMNode QueryInput = objDO.DOM.selectSingleNode("/dfs:myFields/dfs:queryFields/s0:GetPIDs/s0:nRID" );  &lt;br /&gt;	IXMLDOMNode RidNode = thisXDocument.DOM.selectSingleNode("/my:myFields/my:field1");&lt;br /&gt;&lt;br /&gt;	QueryInput.text = RidNode.text;&lt;br /&gt;	objDO.Query();&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;It's failing on the QueryInput = objDO.DOM.selectSingleNode line.  I've read that you may have to set the Namespace before I can select a node, by using the setProperty property of the DOM.  But there is no such property.&lt;br /&gt;&lt;br /&gt;Any code example or ideas would be greatly appreciated.</description></item></channel></rss>