<?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>Re: Query a Web Service with Jscript</title><link>https://www.infopathdev.com:443/forums/thread/17736.aspx</link><pubDate>Thu, 20 Oct 2005 22:41:01 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:17736</guid><dc:creator>vt_asparagus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/17736.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=48&amp;PostID=17736</wfw:commentRss><description>I thought that was a great idea too.</description></item><item><title>Re: Query a Web Service with Jscript</title><link>https://www.infopathdev.com:443/forums/thread/17735.aspx</link><pubDate>Thu, 20 Oct 2005 06:26:11 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:17735</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/17735.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=48&amp;PostID=17735</wfw:commentRss><description>Matt, great idea! InfoPath rules are hard to debug and a tool to step through them would be very cool, but would require hooking InfoPath.exe itself which would require an object model that doesn't exist ... Anyway, debugging declarative logic is a big issue for InfoPath. It's easy to do stuff without code, but it's hard to figure out why it doesn't work. However, the rules do function correctly so it's likely just a matter of trying stuff out over and over again and making sure you have the write order and evaluation conditions.&lt;br /&gt;&lt;br /&gt;Patrick Halstead [InfoPath MVP]&lt;br /&gt;InfoPathDev</description></item><item><title>Re: Query a Web Service with Jscript</title><link>https://www.infopathdev.com:443/forums/thread/17734.aspx</link><pubDate>Wed, 19 Oct 2005 15:51:48 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:17734</guid><dc:creator>Matt Faus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/17734.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=48&amp;PostID=17734</wfw:commentRss><description>I agree with how the rules situation can make things "hidden" a lot of times. I think Microsoft should implement some kind of "Rules Task Pane" where you can see all of the rules throughout the current view in one consolidated section.  The same could be said about default value formulas.&lt;br /&gt;&lt;br /&gt;In Excel a seperate "rules" or "formulas" panel wasn't necessary because you could just selected the cell and it would display the formula in the address bar-type thing at the top. However, now with InfoPath it probably takes about 7 clicks just to be able to see the rules of a certain control.&lt;br /&gt;&lt;br /&gt;---------------&lt;br /&gt;Matt Faus&lt;br /&gt;</description></item><item><title>Re: Query a Web Service with Jscript</title><link>https://www.infopathdev.com:443/forums/thread/17733.aspx</link><pubDate>Wed, 19 Oct 2005 15:07:22 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:17733</guid><dc:creator>TroyE</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/17733.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=48&amp;PostID=17733</wfw:commentRss><description>vt_asparagus:&lt;br /&gt;&lt;br /&gt;Thanks for the feedback.  I agree with the points that you have mentioned.  I've been bitten a couple of times by non-obvious rules put in by other developers.  For this reason, I tend to script actions where possible.&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Troy</description></item><item><title>Re: Query a Web Service with Jscript</title><link>https://www.infopathdev.com:443/forums/thread/17732.aspx</link><pubDate>Wed, 19 Oct 2005 02:11:45 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:17732</guid><dc:creator>vt_asparagus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/17732.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=48&amp;PostID=17732</wfw:commentRss><description>Troy...your code looks solid.  Personal preference, a lot people seem to execute thier data connections through rules, etc. in the form.  I prefer to manually code my interaction with secondary data sources as you have discussed for a couple reasons:&lt;br /&gt;&lt;br /&gt;1 - I can customize a secondary data source, like setting the timeout for a web service call.  I cannot do that through a InfoPath pop-up.&lt;br /&gt;2 - In my opinion, the InfoPath form is more maintainable because all of the data source execution is not embedded down in a rule that another developer may not know about.&lt;br /&gt;3 - I can create re-useable functions to execute queries.&lt;br /&gt;&lt;br /&gt;Just my two cents.</description></item><item><title>Re: Query a Web Service with Jscript</title><link>https://www.infopathdev.com:443/forums/thread/17731.aspx</link><pubDate>Tue, 18 Oct 2005 14:46:11 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:17731</guid><dc:creator>TroyE</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/17731.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=48&amp;PostID=17731</wfw:commentRss><description>Patrick:&lt;br /&gt;&lt;br /&gt;I have looked at MSDN, numerous books, the SDK, online posts, etc.  Nothing seemed to put it all together.  Here is what I have (it may not be pretty, but it seems to be working ...)&lt;br /&gt;&lt;br /&gt;This web service takes a value to identify which type of id is being requested and then returns a unique id. &lt;br /&gt;&lt;br /&gt;I defined the web service as a secondary data source within Infopath.  In setting up the secondary data source, I specified Query:Yes and Submit:No.  I also set up the value to be passed to the web service as part of the secondary data source set up.&lt;br /&gt;&lt;br /&gt;&amp;lt;code snippet&amp;gt;&lt;br /&gt;&lt;br /&gt;//Get a reference to the data object&lt;br /&gt;var objTicketDO = XDocument.DataObjects("GetTicketNumber");&lt;br /&gt;		&lt;br /&gt;//Load the data objects DOM into a new variable so we can&lt;br /&gt;//set the SelectionNamespaces to be able to access/navigate the nodes&lt;br /&gt;var objDOM = objTicketDO.DOM;&lt;br /&gt;&lt;br /&gt;//Access the web service Adapter (the QueryAdapter seems to be where&lt;br /&gt;//data is passed back and forth		&lt;br /&gt;var objWSAdapter = objTicketDO.QueryAdapter;&lt;br /&gt;&lt;br /&gt;//Execute the query to call the web service and get the id&lt;br /&gt;objTicketDO.Query();&lt;br /&gt;&lt;br /&gt;//This seems to be the return value&lt;br /&gt;//This may be due to the way the web service is set up that this works&lt;br /&gt;var objOutputNode = objWSAdapter.OutputLocation;&lt;br /&gt;var tOutput = objOutputNode.text;&lt;br /&gt;&lt;br /&gt;//Set up the namespaces. Otherwise, you can't access the prefixes --&lt;br /&gt;//you get an undeclared namespace prefix&lt;br /&gt;//Looking at the secondary data source within Infopath &lt;br /&gt;//(how it defined it) told me what to use&lt;br /&gt;objDOM.setProperty("SelectionNamespaces",&lt;br /&gt;'xmlns:dfs="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution" ' +&lt;br /&gt;'xmlns:tns="http://www.internalsite.com/TicketDB"');&lt;br /&gt;&lt;br /&gt;//Fetch the response node&lt;br /&gt;//Access the text or nodeTypedValue as needed  &lt;br /&gt;var oTicketResponse =&lt;br /&gt;objDOM.selectSingleNode("/dfs:myFields/dfs:dataFields/tns:GetTicketNumberResponse/tns:GetTicketNumberResult");&lt;br /&gt;&lt;br /&gt;//Some clean up&lt;br /&gt;objTicketDO = null;&lt;br /&gt;objDOM = null;&lt;br /&gt;objWSAdapter = null;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This link did provide some help -&lt;br /&lt;a target="_blank" href=http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ipsdk/html/xdobjWebServiceAdapter_HV01021251.asp&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ipsdk/html/xdobjWebServiceAdapter_HV01021251.asp&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I hope others find this helpful ...&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;TroyE</description></item><item><title>Re: Query a Web Service with Jscript</title><link>https://www.infopathdev.com:443/forums/thread/17730.aspx</link><pubDate>Tue, 18 Oct 2005 07:31:49 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:17730</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/17730.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=48&amp;PostID=17730</wfw:commentRss><description>Hi Troy,&lt;br /&gt;I seem to recall having seen a jscript snippet here or there showing how to do this. Have you checked MSDN and/or the InfoPath SDK?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Patrick Halstead [InfoPath MVP]&lt;br /&gt;InfoPathDev</description></item><item><title>Query a Web Service with Jscript</title><link>https://www.infopathdev.com:443/forums/thread/17490.aspx</link><pubDate>Mon, 17 Oct 2005 17:52:44 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:17490</guid><dc:creator>TroyE</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/17490.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=48&amp;PostID=17490</wfw:commentRss><description>Hello All,&lt;br /&gt;&lt;br /&gt;Background:&lt;br /&gt;- I have created a web service to return a unique ID.&lt;br /&gt;- The web serice is running.  I have tested it and the results are as expected.&lt;br /&gt;- I have added the web service as a data source and can bind it to a control (although this isn't what I need to do).&lt;br /&gt;&lt;br /&gt;Goal(what I am attempting to do):&lt;br /&gt;- Call (Query?) the web service, only as needed, using Jscript.&lt;br /&gt;- Pass a value to the web service and receive a value back.&lt;br /&gt;&lt;br /&gt;I have researched this off and on for a few days, but haven't found any code examples that seem to do this.  I found a C# example that mentioned re-querying, but the web service needs to only be called under specific circumstances.&lt;br /&gt;&lt;br /&gt;Does anyone have an example of this or thoughts/suggestions that might be helpful?  &lt;br /&gt;&lt;br /&gt;Thanks in advance,&lt;br /&gt;Troy</description></item></channel></rss>