3.1 Example 1: Create a New Site and Access List Data

This example describes how to create a new site, create a new list (1), and access the list (1) data. This example builds on the use cases covered in "Create a Site" (section 2.5.1.2), "Create a List and Add a View" (section 2.5.1.3), and "Get List Data" (section 2.5.1.4). In this example, a client application creates a new subsite, creates a new list (1) on that subsite, populates the list (1) with data, and gets a filtered set of list items.

This scenario assumes that:

  • The client application can communicate with the SharePoint site.

  • The client application has permission to create a subsite, create a list (1), read list items, and write list items.

The following steps illustrate the site creation and list access processes, assuming that no errors occur.

  1. The client application calls the method in the Site Web Service Protocol (as described in [MS-SITESS]) that retrieves the list of available site templates and site definitions.

  2. The server returns the collection of available site templates and site definitions.

  3. The client application calls to the method in the Site Web Service Protocol that creates a subsite.

  4. The server returns the URL to the newly created subsite.

  5. The client application uses the URL of the newly created subsite to call the method in the Webs Web Service Protocol (as described in [MS-WEBSS]) that gets the collection of list templates for the subsite.

  6. The server returns the collection of list templates for the new subsite.

  7. The client application calls the method in the Lists Web Service Protocol (as described in [MS-LISTSWS]) that adds a list (1).

  8. The server returns the properties and fields of the new list (1).

  9. The client application calls on the method in the Lists Web Service Protocol that adds items to a list (1).

  10. The server returns the list items that were added to the list (1).

  11. The client application calls the method in the Lists Web Service Protocol that gets list items, and passes a custom query (as described in [MS-WSSCAML] section 2.2).

  12. The server returns the requested list items.

The following figure shows the sequence of steps for this example.

Sequence for creating a new site and accessing list data

Figure 19: Sequence for creating a new site and accessing list data