Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Tuesday, October 11, 2011 1:45 PM
Hi All,
I am getting an exception "Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown" while adding 1000 items to listitem on sharepoint server.
It is working fine while doing the same for 500 items.
C# Code:
Using code:
myList.Credentials = new NetworkCredential
(strUserName,strPassword,strDomain);
XmlDocument doc = new XmlDocument();
doc.Load("TestData.xml");
XmlNodeList xnList = doc.SelectNodes("/Batch");
StringBuilder innerXml = new StringBuilder();
foreach (XmlNode xn in xnList)
{
myList.UpdateListItems("AddContacts", xn);
}
Can anybody suggest the solution.
Regards,
Priti
All replies (8)
Tuesday, October 11, 2011 9:54 PM âś…Answered
Hi,
You could check the following in Sharepoint:
Check the resource throttling settings in your Sharepoint Central Administration website under:
Application Management > Manage Web Applications > (Select the web application that contains the list) > General Settings > Resource Throttling (heading)
You can then change the settings for list thresholds. There is an 'Object Model Override' setting that, if set to 'true', can be used to deploy custom list items above the set threshold using the SP object model.
Tuesday, October 11, 2011 8:27 PM | 1 vote
to have more information on the issue, you should consider
-checking the logs
-using fiddler to try and see what's going on when it fails
Tuesday, November 1, 2011 1:38 PM
Hi,
Here, I am able to add all 1000 items successfully even more than that also in list.But, while it is in progress my code throwing an exception as "Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown" at line
myList.UpdateListItems("AddContacts", xn);
And finally adding all the items to the list.
Functionality is not getting affected but only exception was thrown.
I think resource throttling settings is not an issue in this case.
Can you please help??
Tuesday, November 1, 2011 9:38 PM
Hi,
It appears that it might be how the update to the list is called in your code.
Try calling the list web service and use the GUID for your list instead of the "Add Contacts" parameter:
listService.UpdateListItems("{List GUID here}", batchElement)
See: http://technet.microsoft.com/en-us/query/ms440289
Also note that the UpdateListItems method should only update 160 list items in a single batch.
Wednesday, November 2, 2011 5:11 AM
Hi Kbyrne7,
I tried with GUID as below,
**myList.UpdateListItems("1A77BDAB-704E-4261-8630-DA11BE658DF4" **, xn);
Instead passing parameter name, but It still throwing an exception for more than 500 items.
As you said UpdateListItems method should only update 160 list items in a single batch, In my case UpdateListItems() is updating Till exact 500 items in a batch successfully without any exception but for more than 500 it is thowing exception as well as updating all items also.
What should I do?
Thanks,
Priti
Wednesday, November 2, 2011 12:33 PM
Hi,
There might still be an exception as you have not called the web service. Use 'listService.UpdateListItems' as below:
listService.UpdateListItems("{List GUID here}", batchElement)
The list service is the ASMX resource file used for the web service, for example, a listService.URL would be:
'http://mywebapp/mysitecollection/_vti_bin/Lists.asmx'
Thursday, November 3, 2011 4:35 AM
Hi kbyrne,
Here I have already called the web service as below with my listService url.
mossLists.Lists myList = new mossLists.Lists();
myList.Url ="http://MOSS-2010-DEMO/_vti_bin/Lists.asmx";
And Used as below:
myList.UpdateListItems("1A77BDAB-704E-4261-8630-DA11BE658DF4", xn);
Still not working.
Thursday, November 3, 2011 11:18 AM
Hi,
You could use a Try catch statement to catch the exception.
Also test if an update works on a column with more than 500 items using the following tool from Codeplex:
Once the tool has been downloaded follow these steps, and be sure to use a test 'List' when making the update:
- Select Meta Data in the left menu and enter the url of your SharePoint site containing your list.
- Click Retrieve Lists and choose your list in the Target Document Library drop down box.
- Choose the column to update in the Metadata Column Name drop down box.
- Choose Active in the Current Value drop down box.
- Type Started in the text box New Value.
- Click Update values in column to new value.
Let me know if the above tool updates more than 500 items in a list.