Unspecified Sharepoint Error using SharepointUtility.DLL

Dec 6, 2011 at 3:31 PM

I cannot seem to read a Sharepoint list using the SharepointUtility.DLL.  The other functions seem to work but not the one I need the most :).

This code is mainly copied from one of the examples yet it always gives an error.

        Dim uc As New NetworkCredential("redacted", "redacted", "redacted")
        Dim SharepointURL As Uri = New Uri(SharepointDir & "/_vti_bin/lists.asmx")
        Dim listName As String = "Report"
        Dim fieldNames As IEnumerable(Of String) = New List(Of String)(New String() {"Id"})
        Dim isRecursive As Boolean = False
        Dim pagingSize As Short = 10
        Dim actual As IEnumerable(Of Dictionary(Of String, String))
        Dim Fields As List(Of ColumnData)
        Fields = ListServiceUtility.GetFields(SharepointURL, uc, listName, Nothing)     ' This call works fine
        actual = ListServiceUtility.GetListItemData(SharepointURL, uc, listName, Nothing, fieldNames, <Query/>, isRecursive, pagingSize) ' This call fails

The error I get is always

Unspecified SharePoint Error. A possible reason might be you are trying to retrieve too many items at a time (Batch size)
at Microsoft.Samples.SqlServer.SSIS.SharePointUtility.Adapter.ListsAdapter.GetSharePointListItems(String listName, String viewId, XElement queryXml, XElement viewXml, Int16 pagingSize, XElement queryOptionsXml)

I've pointed this at several Sharepoint servers of various versions (SPS2003, MOSS2007 and SPS2010) and it gives this error on all of them as long as the server URL and List name are pointing at a Sharepoint list.  The call to the the fields always works and the call to get the list item data always fails this way.

Please tell me it's something simple I'm doing wrong :).

Dec 20, 2011 at 8:28 PM

Anyone?

Coordinator
Dec 21, 2011 at 4:40 PM

I just ran that same code without any issue on my test list.  Do you have access to the target SharePoint? Try checking the SharePoint logs to see if there is some other sort of error. Is there perhaps a security restriction against the list items you're running into? 

One thing - the /_vti_bin..  is not needed. You can just pass in the site path as-is.  The suffix is done automatically (not that it will help you here though).

Unspecified errors though, from SharePoint, do not provide any more information. The request is made and sharepoint just says No. and gives that message, so check the server.

Here is what I ran myself..

Dim uc As New Net.NetworkCredential()
'' Dim SharepointURL As Uri = New Uri(SharepointDir & "/_vti_bin/lists.asmx")
Dim SharepointURL As Uri = New Uri(testSslSitePath & "/_vti_bin/lists.asmx")
Dim listName As String = testSslSiteListName
Dim fieldNames As IEnumerable(Of String) = New List(Of String)(New String() {"Id"})
Dim isRecursive As Boolean = False
Dim pagingSize As Short = 10
Dim actual As IEnumerable(Of Dictionary(Of String, String))
Dim Fields As List(Of ColumnData)
Fields = ListServiceUtility.GetFields(SharepointURL, uc, listName, Nothing)     ' This call works fine
actual = ListServiceUtility.GetListItemData(SharepointURL, uc, listName, Nothing, fieldNames, <Query/>, isRecursive, pagingSize) '