How to specify particular MOSS site using Lists.GetListItems?<p>This must be a stupid question since I can't find any answers out there:</p> <p>How should I specify the location of the list (document library) used in Lists.GetListItems?</p> <p>Even though all MOSS sites have a _vti_bin/Lists.asmx, I'm assuming I should always use the generic <a title="http://servername/_vti_bin/Lists.asmx" href="http://servername/_vti_bin/Lists.asmx">http://servername/_vti_bin/Lists.asmx</a> to connect since adding sites as a web reference would require hard-coding.  Also, if I try the hard-coding method, I still can't figure it out.  I'm also assuming that Document Libraries are lists too and can be accessed this way.</p> <p>All the examples suggest just the list name:</p> <p>listService.GetListItems(<br>     &quot;Our Documents&quot;, <br>     null,<br>     ndQuery, <br>     ndViewFields, <br>     null, <br>     ndQueryOptions, <br>     null);</p> <p>I've tried this with every combination of hard-coded web references and list full URLs but I always get &quot;List does not exist. The page you selected contains a list that does not exist. It may have been deleted by another user.&quot; SoapException.</p> <p>Please help me out.</p>© 2009 Microsoft Corporation. All rights reserved.Tue, 22 Jul 2008 19:55:23 Z0d114020-9f87-480d-bead-417b723ab0cdhttp://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/0d114020-9f87-480d-bead-417b723ab0cd#0d114020-9f87-480d-bead-417b723ab0cdhttp://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/0d114020-9f87-480d-bead-417b723ab0cd#0d114020-9f87-480d-bead-417b723ab0cdNicerGuy123123123http://social.msdn.microsoft.com/Profile/en-US/?user=NicerGuy123123123How to specify particular MOSS site using Lists.GetListItems?<p>This must be a stupid question since I can't find any answers out there:</p> <p>How should I specify the location of the list (document library) used in Lists.GetListItems?</p> <p>Even though all MOSS sites have a _vti_bin/Lists.asmx, I'm assuming I should always use the generic <a title="http://servername/_vti_bin/Lists.asmx" href="http://servername/_vti_bin/Lists.asmx">http://servername/_vti_bin/Lists.asmx</a> to connect since adding sites as a web reference would require hard-coding.  Also, if I try the hard-coding method, I still can't figure it out.  I'm also assuming that Document Libraries are lists too and can be accessed this way.</p> <p>All the examples suggest just the list name:</p> <p>listService.GetListItems(<br>     &quot;Our Documents&quot;, <br>     null,<br>     ndQuery, <br>     ndViewFields, <br>     null, <br>     ndQueryOptions, <br>     null);</p> <p>I've tried this with every combination of hard-coded web references and list full URLs but I always get &quot;List does not exist. The page you selected contains a list that does not exist. It may have been deleted by another user.&quot; SoapException.</p> <p>Please help me out.</p>Fri, 02 Feb 2007 03:07:51 Z2007-02-05T03:02:54Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/0d114020-9f87-480d-bead-417b723ab0cd#a79cea05-e81e-4a6d-8f04-94770e602128http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/0d114020-9f87-480d-bead-417b723ab0cd#a79cea05-e81e-4a6d-8f04-94770e602128Ishai Sagi[MOSS MVP]http://social.msdn.microsoft.com/Profile/en-US/?user=Ishai%20Sagi%5bMOSS%20MVP%5dHow to specify particular MOSS site using Lists.GetListItems?<p>you cant use null....</p> <p>And you do need the site ID</p> <p>The following sample code shows how to use the web service, and also a sample function that uses the SiteData web service to get the site url. Please note that i hard coded the site url in the function, but you would do better to get the url of the site you are using with the lists web service.</p> <p> </p><font size=2> <p>ListsWebService.Lists listsWS = </font><font color="#0000ff" size=2>new</font><font size=2> ListsWebService.Lists();</p> <p>listsWS.<font size=2>UseDefaultCredentials = </font><font color="#0000ff" size=2>true</font><font size=2>;</p> <p></font>System.Xml.XmlDocument doc = </font><font color="#0000ff" size=2>new</font><font size=2> System.Xml.XmlDocument();</p> <p>doc.LoadXml (</font><font color="#a31515" size=2>&quot;&lt;Document&gt;&lt;Query /&gt;&lt;ViewFields /&gt;&lt;QueryOptions /&gt;&lt;/Document&gt;&quot;</font><font size=2>);</p> <p>System.Xml.XmlNode listQuery = doc.SelectSingleNode(</font><font color="#a31515" size=2>&quot;//Query&quot;</font><font size=2>);</p> <p>System.Xml.XmlNode listViewFields = doc.SelectSingleNode(</font><font color="#a31515" size=2>&quot;//ViewFields&quot;</font><font size=2>);</p> <p>System.Xml.XmlNode listQueryOptions = doc.SelectSingleNode(</font><font color="#a31515" size=2>&quot;//QueryOptions&quot;</font><font size=2>);</p> <p></font><font color="#2b91af" size=2>Guid</font><font size=2> g = GetWebID();</font><font size=2></p> <p>System.Xml.XmlNode items= listsWS.GetListItems(</font><font color="#a31515" size=2>&quot;Activities&quot;</font><font size=2>, </font><font color="#0000ff" size=2>string</font><font size=2>.Empty, listQuery, listViewFields, </font><font color="#0000ff" size=2>string</font><font size=2>.Empty, listQueryOptions,g.ToString() );</p> <p></font><font size=2></font> </p><font size=2><font size=2> <p></font><font color="#0000ff" size=2>private</font><font size=2> </font><font color="#2b91af" size=2>Guid</font><font size=2> GetWebID()</p> <p>{</p> <p>SiteDataWebService.SiteData siteDataWS = </font><font color="#0000ff" size=2>new</font><font size=2> SiteDataWebService.SiteData();</p> <p>siteDataWS.Credentials = System.Net.CredentialCache.DefaultCredentials;</p> <p>SiteDataWebService._sWebMetadata webMetaData;</p> <p>SiteDataWebService._sWebWithTime[] arrWebWithTime;</p> <p>SiteDataWebService._sListWithTime[] arrListWithTime;</p> <p>SiteDataWebService._sFPUrl[] arrUrls;</p> <p></font><font color="#0000ff" size=2>string</font><font size=2> roles; </font><font color="#0000ff" size=2>string</font><font size=2>[] roleUsers; </font><font color="#0000ff" size=2>string</font><font size=2>[] roleGroups;</p> <p></font><font color="#0000ff" size=2>string</font><font size=2> url = siteDataWS.Url;</p> <p>siteDataWS.Url = </font><font color="#a31515" size=2>&quot;http://myserver/_vti_bin/sitedata.asmx&quot;</font><font size=2>;</p> <p></font><font color="#0000ff" size=2>uint</font><font size=2> i = siteDataWS.GetWeb(</font><font color="#0000ff" size=2>out</font><font size=2> webMetaData, </font><font color="#0000ff" size=2>out</font><font size=2> arrWebWithTime, </font><font color="#0000ff" size=2>out</font><font size=2> arrListWithTime, </font><font color="#0000ff" size=2>out</font><font size=2> arrUrls, </font><font color="#0000ff" size=2>out</font><font size=2> roles, </font><font color="#0000ff" size=2>out</font><font size=2> roleUsers, </font><font color="#0000ff" size=2>out</font><font size=2> roleGroups);</p> <p></font><font color="#2b91af" size=2>Guid</font><font size=2> g = </font><font color="#0000ff" size=2>new</font><font size=2> </font><font color="#2b91af" size=2>Guid</font><font size=2>(webMetaData.WebID);</p> <p></font><font color="#0000ff" size=2>return</font><font size=2> g;</p> <p>}</p></font></font>Fri, 02 Feb 2007 06:26:06 Z2007-02-05T03:02:54Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/0d114020-9f87-480d-bead-417b723ab0cd#62927074-a688-40b2-91b1-f7dcd01e6560http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/0d114020-9f87-480d-bead-417b723ab0cd#62927074-a688-40b2-91b1-f7dcd01e6560NicerGuy123123123http://social.msdn.microsoft.com/Profile/en-US/?user=NicerGuy123123123How to specify particular MOSS site using Lists.GetListItems?<p> </p> <p>Thanks, dude.  That was a super helpful response.  Difficult to get started into the arena armed only with (yet to be completed, IMHO) MOSS msdn reference.</p>Mon, 05 Feb 2007 03:04:54 Z2007-02-05T03:04:54Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/0d114020-9f87-480d-bead-417b723ab0cd#fb658da3-89fd-4d70-a79b-d734c3277fechttp://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/0d114020-9f87-480d-bead-417b723ab0cd#fb658da3-89fd-4d70-a79b-d734c3277fecFbrumhttp://social.msdn.microsoft.com/Profile/en-US/?user=FbrumHow to specify particular MOSS site using Lists.GetListItems?Hello!<br><br>Sorry, but i believe the answer it's right in front of me, but I don't get it!<br>I'm getting an error with SiteDataWebService, ListsOnLocalhost and Sharepoint_Unit_Tests<br><br>For what does this stands for? How to I declare it?<br><br>I'm trying to use getListItems with infopath, but I'm having problems with the definitions of the arguments. So I'm trying to do directly with code.<br><br>But I think that the Microsoft is failing with documentation. It as been impossible to get the arguments right, and it should be so simple. Instead I'm getting vagues SoapServerException!<br><br>Mon, 04 Jun 2007 11:11:19 Z2007-06-04T11:11:19Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/0d114020-9f87-480d-bead-417b723ab0cd#73f0d6ec-9d6f-487e-8804-cb9eca4ba777http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/0d114020-9f87-480d-bead-417b723ab0cd#73f0d6ec-9d6f-487e-8804-cb9eca4ba777Ishai Sagi[MOSS MVP]http://social.msdn.microsoft.com/Profile/en-US/?user=Ishai%20Sagi%5bMOSS%20MVP%5dHow to specify particular MOSS site using Lists.GetListItems?<p>First, it would be polite of you to start a new thread and ask the question in full there, with the code you are trying to use.</p> <p>I suspect you didnt add a referance to the web service in your project. In visual studio you need to right click the project and select &quot;add web referance&quot; which would then allow you to put in the link to the web service you want to use.</p>Mon, 04 Jun 2007 22:31:23 Z2007-06-04T22:31:23Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/0d114020-9f87-480d-bead-417b723ab0cd#8680a226-d4a2-4a06-a699-441639530ab1http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/0d114020-9f87-480d-bead-417b723ab0cd#8680a226-d4a2-4a06-a699-441639530ab1Fbrumhttp://social.msdn.microsoft.com/Profile/en-US/?user=FbrumHow to specify particular MOSS site using Lists.GetListItems?Sorry! I was getting a little frustrated with InfoPath!<br>About the code, it is exactly the one posted here!<br><br>Your suspicions was right, but I already got there. I found it in a msdn blog site.<br>My problem now it is another, that I'm trying to decipher.<br><br>Thanks allot for your response <img height=19 alt=Smile src="http://forums.microsoft.com/MSDN/emoticons/emotion-1.gif" width=19><br><br>Tue, 05 Jun 2007 09:04:03 Z2007-06-05T09:04:03Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/0d114020-9f87-480d-bead-417b723ab0cd#f3c7a70a-77c9-49ab-9613-42547ff7e448http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/0d114020-9f87-480d-bead-417b723ab0cd#f3c7a70a-77c9-49ab-9613-42547ff7e448Hitesh Chauhanhttp://social.msdn.microsoft.com/Profile/en-US/?user=Hitesh%20ChauhanHow to specify particular MOSS site using Lists.GetListItems?<p> </p> <p> </p> <p>Hi,</p> <p> </p> <p>           how can i use sitedata/webs.asmx to get the logged on user mysite quota detail as we have to two different server one is for mysite and another one is for other sharepoint site. please help me with sample code, if you can.</p> <p> </p> <p>Thanks &amp; Regards,</p> <p>Hitesh chauhan</p> <p><br> </p>Fri, 15 Jun 2007 11:56:47 Z2007-06-15T11:56:47Z