10月1日
WSS 3.0 Lists Web Service
The Windows SharePoint Services Web services provided by the Microsoft.SharePoint.SoapServer namespace includes methods that provide Microsoft .NET Framework developers with object models for creating solutions that work with Windows SharePoint Services remotely from a client or custom application. They are defined through the server-side object model of the Microsoft.SharePoint assembly, and their design is optimized to reduce the number of roundtrips transacted between client computer and server.
Most Web services are provided through the /_vti_bin virtual directory, which maps to the \\Program Files\Common Files\Microsoft Shared\web Server extensions\12\ISAPI physical directory. The Administration Web service is provided through the /_vti_adm virtual directory, which maps to \\Program Files\Common Files\Microsoft Shared\web Server extensions\12\ ADMISAPI physical directory.
The following table lists the available Web services:
| Administration Service (admin.asmx)
| Permissions Service (permissions.asmx)
|
| Alerts Service (alerts.asmx)
| Site Data Service (sitedata.asmx)
|
| Copy Service (copy.asmx)
| Site Service (sites.asmx)
|
| Document Workspace Service (dws.asmx)
| Search Service (spsearch.asmx)
|
| Forms Service (forms.asmx)
| Users and Groups Services (usergroup.asmx)
|
| Imaging Service (imaging.asmx)
| Versions Service (versions.asmx)
|
| List Data Retrieval Service (dspsts.asmx)
| Views Service (views.asmx)
|
|
Lists Service (lists.asmx)
| Web Part Pages Service (webpartpages.asmx)
|
| Meetings Service (meetings.asmx)
|
Webs Service (webs.asmx)
|
| People Service (People.asmx)
| |
As titled, this piece will focus on WSS 3.0 Lists Service. The following table lists the Web methods provided by the service to interact with our SharePoint list libraries:
| AddAttachment
| GetListAndView
|
| AddDiscussionBoardItem
| GetListCollection
|
| AddList
| GetListContentType
|
| AddListFromFeature
| GetListContentTypes
|
| ApplyContentTypeToList
| GetListItemChanges
|
| CheckInFile
| GetListItemChangesSinceToken
|
| CheckOutFile
|
GetListItems
|
|
CreateContentType
| GetVersionCollection
|
| DeleteAttachment
| UndoCheckOut
|
| DeleteContentType
|
UpdateContentType
|
| DeleteContentTypeXmlDocument
| UpdateContentTypeXmlDocument
|
| DeleteList
| UpdateContentTypesXmlDocument
|
| GetAttachmentCollection
| UpdateList
|
| GetList
| UpdateListItems |
Now let us start with the walkthrough.
1. Create a SharePoint Web application.
2. Create an ASP.NET Web application and add a Web reference addressed to http://<SharePoint Web application URL>/_vti_bin/Lists.asmx. For demonstration purposes, let us name our Web reference as Proxy.
3. Write the following lines of code to an appropriate event:
Proxy.Lists proxy = new Proxy.Lists();
proxy.Credentials = CredentialCache.DefaultCredentials;
XmlNode xmlnode = proxy.GetListItems("Shared Documents", null, null, null, null, null, null);
XmlNodeReader xmlnodereader = new XmlNodeReader(xmlnode);
DataSet dataset = new DataSet();
dataset.ReadXml(xmlnodereader);
xmlnodereader.Close();
gvwList.DataSource = dataset.Tables[1];
gvwList.DataBind();
Thanks...