All,
I'm trying to develop my own version of the project that can be found here:
http://www.codeproject.com/KB/sharepoint/SharePointListWebService.aspx
Below is the code, similar to what he's posted, for pulling list items from our MOSS calendar.
mosslists.ListslistService=newmosslists.Lists();
//SharePointWebServicesrequireauthentication
listService.Credentials=System.Net.CredentialCache.DefaultCredentials;
StringnewIssueTitle="Programmaticallyaddedissue";
StringlistGUID="{5B62B9F4-F0CA-4CC5-9753-87A5EB129E3C}";
StringactiveItemViewGUID="{52CDD743-D45B-4548-A521-AA1C7DED4B24}";
stringstrBatch=
""+
String.Format("{0}",newIssueTitle)+
"";
XmlDocumentxmlDoc=newSystem.Xml.XmlDocument();
System.Xml.XmlElementelBatch=xmlDoc.CreateElement("Batch");
elBatch.SetAttribute("OnError","Continue");
elBatch.SetAttribute("ViewName",activeItemViewGUID);
elBatch.InnerXml=strBatch;
XmlNodendReturn=listService.UpdateListItems(listGUID,elBatch);
I'm getting an error on that last line:
XmlNodendReturn=listService.UpdateListItems(listGUID,elBatch);
The error message is as follows:
Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown.Looked at the return packet from the server, and I noticed that the innertext of the error was as follows:
The system cannot find the file specified. (Exception from HRESULT: 0x80070002)Also, I retrieved the GUIDs you see in the above code by using the utility available here:
http://blogs.msdn.com/ronalus/archive/2007/09/08/a-little-guid-picker.aspxAnd in my google quests, most answers revolved around making sure the Web Service reference is added to the MOSS subsite, not the root site. I want to say now, that I've been careful to attach to the correct site.
EDIT: Mark's Syntax Highlighter took all or most of the spaces out of my code. Try to ignore that, I'm compiling just fine, no code syntax errors.
-Mobius