<?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: SoapException -- The expression in the 'select' attribute must select a list ..?</title><link>https://www.infopathdev.com:443/forums/thread/68864.aspx</link><pubDate>Mon, 01 Aug 2011 17:43:03 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:68864</guid><dc:creator>ThoughtProcess</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/68864.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=68864</wfw:commentRss><description>&lt;p&gt;Just for future reference, I didn&amp;#39;t have much luck with the StsAdapter problem, but I did have success with the &lt;a href="http://msdn.microsoft.com/en-us/library/lists%28v=office.12%29.aspx" title="Lists Web Service"&gt;Lists Web Service&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;You can see an example of the code in action on the &lt;a href="http://msdn.microsoft.com/en-us/library/lists.lists.getlistitems%28v=office.12%29.aspx" title="MSDN page for Lists.GetListItems()"&gt;MSDN page for Lists.GetListItems()&lt;/a&gt;.&amp;nbsp; I&amp;#39;ve pasted the relevant code snippet below:&lt;/p&gt;&lt;pre&gt;Web_Reference_Folder.Lists listService = &lt;span style="color:Blue;"&gt;new&lt;/span&gt; Web_Reference_Folder.Lists();
listService.Credentials= System.Net.CredentialCache.DefaultCredentials;

XmlDocument xmlDoc = &lt;span style="color:Blue;"&gt;new&lt;/span&gt; System.Xml.XmlDocument();

XmlNode ndQuery = xmlDoc.CreateNode(XmlNodeType.Element,&lt;span style="color:#A31515;"&gt;&amp;quot;Query&amp;quot;&lt;/span&gt;,&lt;span style="color:#A31515;"&gt;&amp;quot;&amp;quot;&lt;/span&gt;);
XmlNode ndViewFields = 
    xmlDoc.CreateNode(XmlNodeType.Element,&lt;span style="color:#A31515;"&gt;&amp;quot;ViewFields&amp;quot;&lt;/span&gt;,&lt;span style="color:#A31515;"&gt;&amp;quot;&amp;quot;&lt;/span&gt;);
XmlNode ndQueryOptions = 
    xmlDoc.CreateNode(XmlNodeType.Element,&lt;span style="color:#A31515;"&gt;&amp;quot;QueryOptions&amp;quot;&lt;/span&gt;,&lt;span style="color:#A31515;"&gt;&amp;quot;&amp;quot;&lt;/span&gt;);

ndQueryOptions.InnerXml = 
    &lt;span style="color:#A31515;"&gt;&amp;quot;&amp;lt;IncludeMandatoryColumns&amp;gt;FALSE&amp;lt;/IncludeMandatoryColumns&amp;gt;&amp;quot;&lt;/span&gt; + 
    &lt;span style="color:#A31515;"&gt;&amp;quot;&amp;lt;DateInUtc&amp;gt;TRUE&amp;lt;/DateInUtc&amp;gt;&amp;quot;&lt;/span&gt;;
ndViewFields.InnerXml = &amp;quot;&amp;lt;FieldRef Name=&lt;span style="color:#A31515;"&gt;&amp;#39;Field1&amp;#39;&lt;/span&gt; /&amp;gt;
    &amp;lt;FieldRef Name=&lt;span style="color:#A31515;"&gt;&amp;#39;Field2&amp;#39;&lt;/span&gt;/&amp;gt;&amp;quot;;
ndQuery.InnerXml = &lt;span style="color:#A31515;"&gt;&amp;quot;&amp;lt;Where&amp;gt;&amp;lt;And&amp;gt;&amp;lt;Gt&amp;gt;&amp;lt;FieldRef Name=&amp;#39;Field1&amp;#39;/&amp;gt;&amp;quot;&lt;/span&gt; + 
    &lt;span style="color:#A31515;"&gt;&amp;quot;&amp;lt;Value Type=&amp;#39;Number&amp;#39;&amp;gt;5000&amp;lt;/Value&amp;gt;&amp;lt;/Gt&amp;gt;&amp;lt;Gt&amp;gt;&amp;lt;FieldRef Name=&amp;#39;Field2&amp;#39;/&amp;gt;&amp;quot;&lt;/span&gt; + 
    &amp;quot;&amp;lt;Value Type=
        &lt;span style="color:#A31515;"&gt;&amp;#39;DateTime&amp;#39;&lt;/span&gt;&amp;gt;2003-07-03T00:00:00&amp;lt;/Value&amp;gt;&amp;lt;/Gt&amp;gt;&amp;lt;/And&amp;gt;&amp;lt;/Where&amp;gt;&amp;quot;;
&lt;span style="color:Blue;"&gt;try&lt;/span&gt;
{
    XmlNode ndListItems = 
        listService.GetListItems(&lt;span style="color:#A31515;"&gt;&amp;quot;List_Name&amp;quot;&lt;/span&gt;, &lt;span style="color:Blue;"&gt;null&lt;/span&gt;, ndQuery, 
        ndViewFields, &lt;span style="color:Blue;"&gt;null&lt;/span&gt;, ndQueryOptions, &lt;span style="color:Blue;"&gt;null&lt;/span&gt;);
    MessageBox.Show(ndListItems.OuterXml);
}

&lt;span style="color:Blue;"&gt;catch&lt;/span&gt; (System.Web.Services.Protocols.SoapException ex)
{
    MessageBox.Show(&lt;span style="color:#A31515;"&gt;&amp;quot;Message:\n&amp;quot;&lt;/span&gt; + ex.Message + &lt;span style="color:#A31515;"&gt;&amp;quot;\nDetail:\n&amp;quot;&lt;/span&gt; + 
        ex.Detail.InnerText + 
         &lt;span style="color:#A31515;"&gt;&amp;quot;\nStackTrace:\n&amp;quot;&lt;/span&gt; + ex.StackTrace);
}&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Thanks guys! &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: SoapException -- The expression in the 'select' attribute must select a list ..?</title><link>https://www.infopathdev.com:443/forums/thread/68662.aspx</link><pubDate>Sun, 24 Jul 2011 20:38:41 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:68662</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/68662.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=68662</wfw:commentRss><description>&lt;p&gt;Hi ThoughtProcess,&lt;/p&gt;
&lt;p&gt;Just an FYI, we try to respond to 90% of all forum posts. It&amp;#39;s not 100% because we can&amp;#39;t debug everyone&amp;#39;s examples or we wouldn&amp;#39;t have time to do real work and earn a meager living. Thank you for your understanding! &lt;/p&gt;
&lt;p&gt;Hopefully, you will hook someone who can easily debug your code. If not, we&amp;#39;d be happy to provide paid support at competitve hourly rates ...&lt;/p&gt;</description></item><item><title>SoapException -- The expression in the 'select' attribute must select a list ..?</title><link>https://www.infopathdev.com:443/forums/thread/68643.aspx</link><pubDate>Fri, 22 Jul 2011 18:07:11 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:68643</guid><dc:creator>ThoughtProcess</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/68643.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=68643</wfw:commentRss><description>&lt;p&gt;Hi guys!&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I&amp;#39;m trying out another sample from the MSDN 
documentation, this time on the StsAdapter.Query method.&amp;nbsp; The full code 
is available &lt;br /&gt;
&lt;a href="http://msdn.microsoft.com/en-us/library/ms774520%28v=office.12%29.aspx" title="here"&gt;here&lt;/a&gt;.&amp;nbsp;
 My understanding is that &amp;quot;Web_Reference_Folder&amp;quot; and 
&amp;quot;Web_Reference_Name&amp;quot; should point to the Web References that I imported 
into my Visual Studio For Applications project.&lt;br /&gt;
&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;pre&gt;Web_Reference_Folder.StsAdapter myStsAd = &lt;span style="color:Blue;"&gt;new&lt;/span&gt; Web_Reference_Folder.StsAdapter();
myStsAd.Credentials= System.Net.CredentialCache.DefaultCredentials;

&lt;span style="color:Blue;"&gt;string&lt;/span&gt;[] vArray = &lt;span style="color:Blue;"&gt;new&lt;/span&gt; &lt;span style="color:Blue;"&gt;string&lt;/span&gt;[1];
vArray[0] = &lt;span&gt;&amp;quot;1.0&amp;quot;&lt;/span&gt;;
Web_Reference_Name.Versions myVersion = &lt;span style="color:Blue;"&gt;new&lt;/span&gt; Web_Reference_Name.Versions();
myVersion.version = vArray;

myStsAd.versions = myVersion;

Web_Reference_Name.RequestHeader reqHeader = &lt;span style="color:Blue;"&gt;new&lt;/span&gt; Web_Reference_Name.RequestHeader();
reqHeader.document = Web_Reference_Name.DocumentType.content;
reqHeader.method = Web_Reference_Name.MethodType.query;

myStsAd.request = reqHeader;

Web_Reference_Name.QueryRequest myRequest = &lt;span style="color:Blue;"&gt;new&lt;/span&gt; Web_Reference_Name.QueryRequest();

Web_Reference_Name.DSQuery sQuery = &lt;span style="color:Blue;"&gt;new&lt;/span&gt; Web_Reference_Name.DSQuery();
sQuery.&lt;span style="color:Blue;"&gt;select&lt;/span&gt; = &lt;span&gt;&amp;quot;/list[@id=&amp;#39;{e5c6603b-0f6c-4bd9-8bb1-57c83854308b}&amp;#39;]&amp;quot;&lt;/span&gt;;   &lt;span style="font-weight:bold;"&gt; // I changed this to my SharePoint list&amp;#39;s GUID&lt;/span&gt;

myRequest.dsQuery = sQuery;

Web_Reference_Name.DspQuery spQuery = &lt;span style="color:Blue;"&gt;new&lt;/span&gt; Web_Reference_Name.DspQuery();
XmlDocument xmlDoc = &lt;span style="color:Blue;"&gt;new&lt;/span&gt; System.Xml.XmlDocument();
XmlElement ndQuery = xmlDoc.CreateElement(&lt;span&gt;&amp;quot;And&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;&lt;span style="font-weight:bold;"&gt;// I changed this section to query two text columns in my list&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style="font-weight:bold;"&gt;&lt;/span&gt;ndQuery.InnerXml = &lt;span&gt;&amp;quot;&amp;lt;Eq&amp;gt;&amp;lt;FieldRef Name=\&amp;quot;Author\&amp;quot;/&amp;gt;&amp;quot;&lt;/span&gt; +
    &lt;span&gt;&amp;quot;&amp;lt;Value&amp;gt;Name&amp;lt;/Value&amp;gt;&amp;lt;/Eq&amp;gt;&amp;quot;&lt;/span&gt; + 
    &lt;span&gt;&amp;quot;&amp;lt;Gt&amp;gt;&amp;lt;FieldRef Name=\&amp;quot;Number\&amp;quot;/&amp;gt;&amp;quot;&lt;/span&gt; + 
    &lt;span&gt;&amp;quot;&amp;lt;Value&amp;gt;Number&amp;lt;/Value&amp;gt;&amp;lt;/Gt&amp;gt;&amp;quot;&lt;/span&gt;;
spQuery.Where = ndQuery;

myRequest.dsQuery.Query = spQuery;

&lt;span style="color:Blue;"&gt;try&lt;/span&gt;
{
    XmlNode myNode = myStsAd.Query(myRequest);
    MessageBox.Show(myNode.OuterXml);
}

&lt;span style="color:Blue;"&gt;catch&lt;/span&gt; (System.Web.Services.Protocols.SoapException ex)
{
    MessageBox.Show(ex.Message + ex.StackTrace);
}&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;When I run the code, I get the following exception:&lt;/p&gt;&lt;p&gt;The expression in the &amp;#39;select&amp;#39; attribute must select a list.&lt;br /&gt;
&amp;nbsp;&amp;nbsp; at 
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage
 message, WebResponse response, Stream responseStream, Boolean 
asyncCall)&lt;br /&gt;
&amp;nbsp;&amp;nbsp; at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)&lt;br /&gt;
&amp;nbsp;&amp;nbsp; at 
ThoughtProcessProject.com.myCompany.sharepoint1.StsAdapter.Query(QueryRequest
 queryRequest) in 
c:\\projects\\SharePoint\\InfoPath\\ThoughtProcessProject\\Web 
References\\com.myCompany.sharepoint1\\Reference.cs:line 127&lt;br /&gt;
&amp;nbsp;&amp;nbsp; at ThoughtProcessProject.FormCode.SearchForOldItems(Int32 swVerIdx, 
Int32 releaseNum) in 
c:\\projects\\SharePoint\\InfoPath\\ThoughtProcessProject\\FormCode.cs:line
 220&amp;quot; &lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Any ideas? &lt;br /&gt;
&lt;/p&gt;</description></item></channel></rss>