Creating\Updating list items in subsite via Sharepoint webservices

If you ever want to add or update a list item in your subsite using SharePoint's Lists.asmx webservice you would notice that that even after registering the subsite's lists.asmx url you would end up updating the item on the parent site instead.

To solve this issue simply set the webservice url in your code to point to the subsite url(see below)

ListService.Credentials = System.Net.CredentialCache.DefaultCredentials;

ListService.Url = "https://SPParentSite/subsite/_vti_bin/Lists.asmx";

simple isn't it.

0 comments:

Post a Comment

Disclaimer

This is a personal weblog. The opinions expressed here represent my own and not those of my employer or anyone else. Should you have any questions or concerns please e-mail me at sharepointprogrammingblogger@gmail.com .

Copyright (c) 2010 @ myshaepointwork.blogspot.com. All rights are reserved.Do Not Copy.

@ Learning SharePoint.com