Have you ever wanted to update a SharePoint list with data from a web service? Web services are designed to provide the means for software to connect to other software applications. Although there are many software packages that automate integration between SharePoint and other systems, writing your own code to access a web service and integrate it into SharePoint is also a possibility that is well within the skill set of the average programmer. By leveraging the SharePoint Object model, you can write a program that will retrieve data from a web service and update items in a SharePoint list.
SharePoint itself comes with very robust SOAP-based web services that can both read and write to almost any aspect of SharePoint. These are designed to integrate SharePoint capabilities into applications that run on computers where SharePoint 2010 has not been installed. Although these services provide a fuller range of capabilities than SharePoint’s managed client object model, they do not provide the same performance and design advantages, such as batching and exception handling. For this reason it is recommended to use the SharePoint object model to write data to a SharePoint list when running server-side or client-side code.
In order to demonstrate how to update a SharePoint list with data from a web service, we will be interfacing with a demo web service from ADP® (Automatic Data Processing, Inc.) called ADP® Employease Extend, which is a part of the ADP® HR / Benefits Solution. This demo web service provides a group of WSDLs that will allow us to interact with dummy employee information stored in a database. We will be using this information to update data in a SharePoint list containing employee data. The solution we will be describing was built on a development platform with SharePoint 2010 Foundation installed and the code was written in C# with Visual Studio 2012. Before we can begin, however, the Web Services Enhancements (WSE) 3.0 for Microsoft .NET will have to be installed. The Employease Extend web service uses this component for authentication, and because it is a part of Microsoft .NET Framework 2.0, it will have to be set up on the development platform before you can reference it in Visual Studio. This component can be downloaded here:
In our next post about SharePoint 2010 external data, we will be creating a project in VS2012 and adding code to connect to the ADP web service.