IntroductionOne of the difficulties when we develop applications in support of SharePoint is to realize the necessity of a server where SharePoint is installed, now imagine you can develop support tools and access to data in SharePointwithout developing or using the Server's DLL's in Sharepoint as "Microsoft.SharePoint.dll, "the answer is simple, using Web Services. Scenario:Often there is a need for applications in customer support or Listing Data in SharePoint to other databases for integratingtion made to measure.
Great, how's Web Services for SharePoint canm help? OverviewMicrosoft SharePoint provides a set of Web Services that support the external application.Web Services are methods for listing and support to the method using SOAP and XML, used properly is a very important tool in your development. Web Services are on the server where SharePoint is installed: % CommonProgramFiles% \ Microsoft Shared \ web server extensions \ 12 \ ISAPI Link to List of Web Services that SharePoint provides http://msdn.microsoft.com/pt-br/library/bb862916.aspx.
In this example I will make an application in Windows Forms to List all users of a SharePoint site.To call the web services will use the method "UserGroup " I will use to listthe users Site st.
Example http:// [url] / _vti_bin / UserGroup.asmx? WSDL One of the features. Net is the ability to convert our Web Services Classes. .Net,even though it read.Microsoft SharePoint for each area Web Services with many methods that will serve to support our development. Conversion WebService for Class. CSPATH C: \ Program Files \ Microsoft Visual Studio 8 \ SDK \ v2.0 \ Bin "
wsdl.exe / l: CS / n: Company /October: C: \ListaSharepoint\UserGroup.cs http:// [url] / _vti_bin / UserGroup.asmx? WSDL Commands: - / L: Language that will be converted "VB" or "CS"
- / N: namespace of the class constructed
- / October: file converted from WebService
After using the command line to convert the Web Service in class, we can add our solution in Windows Forms and use their methods to developments. Windows Forms Listing usersAfter adding the new class can start using our methods to list the users to use content from our Web Services will need to use classes to return XML users. Example for Listing visitors UserGroup user = new UserGroup();
/ / Sharepoint Site to search users
utilizadores.Url = String. Concat (TxtUrl.Text,"/ _vti_bin / usergroup.asmx");
/ / User Credentials
utilizadores.Credentials = CredentialCache. DefaultCredentials
XmlNode userNodes utilizadores.GetAllUserCollectionFromWeb = ();
DataSet dsXML = new DataSet();using (XmlNodeReader reader = new XmlNodeReader(userNodes))
(
dsXML.ReadXml (reader);
)
String[] username = new String[dsXML.Tables ["User"]. Rows.Count];
/ / List of usersfor (int i = 0; i <dsXML.Tables ["User"]. Rows.Count; i + +)
(
LstUtilizadores.Items.Add (dsXML.Tables ["User"]. Rows [i] ["loginname"]. ToString ());
)
) Attach web service in client. Done, we list all users of the site using the SharePoint Web Services for SharePoint, can begin to make application in Windows Formswithout using the DLL "Microsoft.SharePoint.dll. Sample Project SourceDownload source files -131 kb |