views:

1481

answers:

2

Hi,

I have the following statement in my code:

System.Xml.XmlNode items = lstWebs.GetListItems(
    "Tasks", string.Empty, listQuery, listViewFields,
    string.Empty, listQueryOptions, WorkspaceId);

When executing this, the following exception occurs:

Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown.

Exception Source is:
System.Web.Services

Stack Trace:
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at ImpersonationConsoleApp.MossLists.Lists.GetListItems(String listName, String viewName, XmlNode query, XmlNode viewFields, String rowLimit, XmlNode queryOptions, String webID) in C:\Documents and Settings\david\My Documents\_Dew02SiteCreator\DeWProjectStarter\ImpersonationConsoleApp\Web References\MossLists\Reference.cs:line 435
   at ImpersonationConsoleApp.Program.DeleteTasksIfNotExist(DataRow[] drTasksdel, String siteURL) in C:\Documents and Settings\david\My Documents\_Dew02SiteCreator\DeWProjectStarter\ImpersonationConsoleApp\Program.cs:line 1384

I have confirmed the site URL and it is fine.

Could you please help on why the exception is occurring? Do I need to reset IIS?

please find the detail. SoapException.InnerException is Null. However the soapExcetion.Detail.InnerText is showing: The system cannot find the file specified. (Exception from HRESULT: 0x80070002)

Thanks Azra

A: 

Is the name tasks also the actual listname in the url? i.e. http://siteurl/lists/tasks? is the list in a subsite and are you using the service under the site-collection?

IF the list is in a subsite the use http://sitecollectionurl/subsite/_vti_bin/lists.asmx as the Service url, otherwise the lists.asmx will try to find the tasks list in the rootweb instead of the subsite.

Colin
A: 

Have you tried running with elevated permissions, it looks like the running user does not hav sufficient privileges to query the data...

SPSecurity.RunWithElevatedPrivileges

UJ