SharePoint Web Services

SharePoint has several web services available that make it easy to access and manipulate content and configure SharePoint (WSS and MOSS) from external applications. Here is a quick list and general information about each service.

Administration Web Service
Authentication Web Service
Alerts Web Service
Copy Web Service
Document Workspace Web Service
Forms Web Service
Imaging Web Service
List Data Retrieval Web Service
Lists Web Service
  • Purpose:Create and manage SharePoint lists
  • Access: http://<server-url>/_vti_bin/lists.asmx
  • Available To: WSS and MOSS
  • SDK: http://msdn.microsoft.com/en-us/library/lists.aspx
  • Operations: AddAttachment, AddDiscussionBoardItem, AddList, AddListFormFeature, ApplyContentTypeToList, CheckInFile, CheckOutFile, CreateContentType, DeleteAttachment, DeleteContentType, DeleteContentTypeXmlDocument, DeleteList, GetAttachmentCollection, GetList, GetListAndView, GetListCollection, GetListContentType, GetListContentTypes, GetListItemChanges, GetListItemChangesSinceToken, GetListItems, GetVersionCollection, UndoCheckOut, UpdateContentType, UpdateContentTypeXmlDocument, UpdateContentTypesXmlDocument, UpdateList, UpdateListItems
Meetings Web Service
People Web Service
Permissions Web Service
Site Data Web Service
Sites Web Service
Users and Groups Web Service
  • Purpose: Manage SharePoint users and groups
  • Access: http://<server-url>/_vti_bin/usergroup.asmx
  • Available To: WSS and MOSS
  • SDK: http://msdn.microsoft.com/en-us/library/ms772647.aspx
  • Operations: AddGroup, AddGroupToRole, AddRole, AddRoleDef, AddUserCollectionToGroup, AddUserCollectionToRole, AddUserToGroup, GetAllUserCollectionFromWeb, GetGroupCollection, GetGroupCollectionFromRole, GetGroupCollectionFromSite, GetGroupCollectionFromuser, GetGroupCollectionFromWeb, GetGroupInfo, GetRoleCollection, GetRoleCollectionFromGroup, GetRoleCollectionFromUser, GetRoleCollectionFromWeb, GetRoleInfo, GetRolesAndPermissionsForCurrentUser, GetRolesAndPermissionsForSite, GetUserCollection, GetUserCollectionFromGroup, GetUserCollectionFromRole, GetUserCollectionFromSite, GetUserCollectionFromWeb, GetUserInfo, GetUserLoginFromEmail, RemoveGroup, RemoveGroupFromRole, RemoveRole, RemoveUserCollectionFromGroup, RemoveUserCollectionFromRole, RemoveUserCollectionFromSite, RemoveUserFromGroup, RemoveUserFromRole, RemoveUserFromSite, RemoveUserFromWeb, UpdateGroupInfo, UpdateRoleDefInfo, UpdateRoleInfo, UpdateUserInfo
Versions Web Service
Views Web Service
Web Part Pages Web Service
  • Purpose:Manage SharePoint Web Parts
  • Access: http://<server-url>/_vti_bin/webpartpages.asmx
  • Available To: WSS and MOSS
  • SDK: http://msdn.microsoft.com/en-us/library/ms774569.aspx
  • Operations: AddWebPart, AddWebPartToZone, AssociateWorkflowMarkup, ConvertWebPartFormat, DeleteWebPart, ExecuteProxyUpdates, FetchLegalWorkflowActions, GetAssemblyMetaData, GetBindingResourceData, GetCustomControlList, GetDataFromDataSourceControl, GetFormCapabilityFromDataSourceControl, GetSafeAssemblyInfo, GetWebpart, GetWebpart2, GetWebPartCrossPageCompatibililty, GetWebPartPage, GetWebPartPageConnectionInfo, GetWebPartPageDocument, GetWebPartProperties, GetWebPartProperties2, GetXmlDataFromDataSource, RemoveWorkflowAssociation, RenderWebpartForEdit, SaveWebPart, SaveWebPart2, ValidateWorkflowMarkupAndCreateSupportObjects
Webs Web Service
  • Purpose:Manage SharePoint sites and subsites
  • Access: http://<server-url>/_vti_bin/webs.asmx
  • Available To: WSS and MOSS
  • SDK: http://msdn.microsoft.com/en-us/library/webs.aspx
  • Operations: CreateContentType, CustomizeCss, DeleteContentType, GetActivatedFeatures, GetAllSubWebCollection, GetColumns, GetContentType, GetContentTypes, GetCustomizedPageStatus, GetListTemplates, GetWeb, GetWebCollection, RemoveContentTypeXmlDocument, RevertAllFileContentStreams, RevertCss, RevertFileContentStream, UpdateColumns, UpdateContentType, UpdateContentTypeXmlDocument, WebUrlFromPageUrl

How to format a date field in the SPGridView control

Ever use the SPGridView control and have the need to format a date column? It’s actually pretty simple.

 

BoundField field1 = new BoundField();
field1.HeaderText = “Date Field”;
field1.DataField = “DateField”;
field1.HtmlEncode = true;
field1.DataFormatString = @”{0:M/dd/yyyy}”;
_ResultsGridView.Columns.Add(field1);

The key is to set HtmlEncode to true and set the DataFormatString with the appropriate date format.

 

About the SharePoint !New icon

How long does the “New” image appear next to new list items?

2 days is the default

How do I change the number of days that the “New” icon is displayed?

This value can be changed per web application through the stsadm tool.

stsadm -o setproperty -propertyname days-to-show-new-icon -propertyvalue <Number of days> [-url <http://servername>%5D

You can use -pn instead of -propertyname and -pv instead of -propertyvalue

To set the number of days to 7 days you would use the following:

stsadm -o setproperty -pn days-to-show-new-icon -pv 7 -url http://servername

How do I check the number of days that the “New” icon is currently set to display?

This can also be checked through the stsadm tool.

stsadm -o getproperty -pn days-to-show-new-icon -url http://servername

An easy way to browse SharePoint images

When you need images for dashboards or other SharePoint projects, it can be time consuming to find the right images. SharePoint comes with thousands of images all located in the 12 hive in the /layouts/images directory.

Peter Allen at Bits of SharePoint has created an organized listing of these SharePoint Layout Images that include a  thumbnail and filename. This makes finding the right image much easier. Thanks Peter!

Field Grouping with SPGridView – More than one group returned for a single value

It is very easy to group by a field using the SharePoint SPGridView control. Just set some properties and your good to go.

resultsGridView.GroupField = “Status”;
resultsGridView.GroupFieldDisplayName = “Status”;
resultsGridView.GroupDescriptionField = “Description”;
resultsGridView.AllGroupCollapse = true;
resultsGridView.DisplayGroupFieldName = false;

However, depending on how your results are sorted, you may see that you get multiple groups for a single value. The way to fix this is to sort by the same field you are grouping by.

In this first example, I am grouping by “Status” and sorting only by “DueDate”

SPSiteDataQuery Group Error

In this example, I am still grouping by “Status” but now I am first sorting by “Status” and then by “Due Date”

SPSiteDataQuery Group No Error

You may not notice this issue right away. It all depends on the value of your results and how they are sorted.  So while it may work right off the bat, later on the issue may pop up!

SharePoint Solution Installer – Make deployments look professional

SharePoint Solution Installer is a CodePlex product that makes it easy to deploy SharePoint Solutions (.WSP files). With a simple update to the config file you can customize the way the solutions are deployed. When ready to install, double-click the Setup.exe file and the installer will walk you through the deployment of your .WSP. After some system checks it will give you a choice to do an install if this is a new deployment, or an upgrade/uninstall if the solution already exists in the environment.

It’s a simple way to save some time and also give SharePoint Solution deployments a more professional feel.

SolutionInstaller

http://www.codeplex.com/sharepointinstaller

Search SharePoint content from Windows 7

Windows 7 has a feature called “Federated Search” that allows you to search other content sources through windows explorer. This works with SharePoint and is pretty easy to setup.

How to create your own search

1. Create a text file that contains the following XML, modify everything in double brackets [[ ]] to meet your needs (be sure to remove the brackets also).

<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:ms-ose="http://schemas.microsoft.com/opensearchext/2009/">
<ShortName>[[Search SharePoint]]</ShortName>
<Description>[[Search my SharePoint site]]</Description>
<Url type="application/rss+xml" template="http://[[sharepointsiteurl]]/_layouts/srchrss.aspx?k={searchTerms}&amp;start={startIndex}&amp;s=[[Scope Name]]"/>
<Url type="text/html" template="[[URL to Search Results.aspx page]]?k={searchTerms}&amp;s=[[Scope Name]]"/>
<ms-ose:ResultsProcessing format="application/rss+xml">
<ms-ose:LinkIsFilePath>-1</ms-ose:LinkIsFilePath>
</ms-ose:ResultsProcessing>
</OpenSearchDescription>

 

2. Save the file and change the extension to .osdx

 

3. Double click your new .osdx file and Windows will ask if you want to save the search.

 

4. The search should appear in the left pane of Windows Explorer. Just click on it to do a search.