<?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>Accessing DataSource via Web Service - Error when no matching results</title><link>https://www.infopathdev.com:443/forums/thread/97907.aspx</link><pubDate>Wed, 11 Jun 2014 15:08:36 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:97907</guid><dc:creator>MikeH</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/97907.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=48&amp;PostID=97907</wfw:commentRss><description>&lt;p&gt;Hi All, &lt;/p&gt;&lt;p&gt;Any advice/suggestions would be much appreciated on the following issue I am experiencing.&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;u&gt;Overview:&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;I am trying to get a count of the matching WinAccounts from a datasource via a Web Service.&amp;nbsp; So a user opens the form, they click Get Count, the form accesses a datasource and finds how many matches there are for the current form user.&lt;/p&gt;&lt;p&gt;If there is a match then a count is successfully returned which is great - exactly what I want.&amp;nbsp; However if there are no matches, an error is displayed.&amp;nbsp; It needs some kind of error handling for the event that there are no matches.&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;u&gt;Error:&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;The query cannot be run for the following DataObject: GetContact&lt;br /&gt;InfoPath cannot run the specified query.&lt;br /&gt;The SOAP response indicates that an error occurred on the server:&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;Server was unable to process request. ---&amp;gt; Failed to Get Contact for&amp;nbsp;User1 ---&amp;gt; Failed to Get Contact for&amp;nbsp; User1 ---&amp;gt; Failed to get contact details for&amp;nbsp; User1&lt;br /&gt;&amp;nbsp;---&amp;gt; Failed to get contact details for&amp;nbsp; User1&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;u&gt;Details:&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;I have&amp;nbsp;1 field called&amp;nbsp;&lt;strong&gt;Count&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;I have 1 DataConnection called &lt;strong&gt;GetContact&lt;/strong&gt;.&amp;nbsp; This is a RECIEVE connection&amp;nbsp;using&amp;nbsp;a webservice.&amp;nbsp; The DataSource has&amp;nbsp;2 columns, ID and WindowsAccount&lt;/p&gt;&lt;p&gt;I have 1 button on the form called &amp;#39;Get Count&amp;#39;.&lt;/p&gt;&lt;p&gt;I have 3 rules on the button Get Count&amp;nbsp;as follows:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Set query field for web service to current form user&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Set a fields value: WindowsAccount (&lt;em&gt;a query field on GetContact Data Connection&lt;/em&gt;) = userName()&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Execute Query&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Query using a data connection:GetContact&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Get&amp;nbsp;Count&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Set a fields value: Count = count(ID)&lt;/li&gt;&lt;/ul&gt;</description></item></channel></rss>