There are many way to code. One way is to use Sharepoint object model, Other way is to use web services to communicate with server and code it.
Here is a way how we can use web services to accomplish our tasks.
Before we start looking in this, let me give you highlights of where these web services are located and later we will see that how these can be used.
All Web services are inside "_vti_bin"
WSS Web Services Web Reference
Administration Service http:///_vti_adm/admin.asmx
Alerts Service http:///_vti_bin/alerts.asmx
Document Workspace Service http:///_vti_bin/dws.asmx
Forms Service http:///_vti_bin/forms.asmx
Imaging Service http:///_vti_bin/imaging.asmx
List Data Retrieval Service http:// /_vti_bin/dspsts.asmx
Lists Service http:///_ vti_bin/lists.asmx
Meetings Service http:/// _vti_bin/meetings.asmx
Permissions Service http:// /_vti_bin/permissions.asmx
Site Data Service http:///_vti_bin/sitedata.asmx
Site Service http:///_vti_bin/sites.asmx
Users and Groups Service http:///_vti_bin/usergroup.asmx
Versions Service http:///_vti_bin/versions.asmx
Views Service http:///_vti_bin/views.asmx
Web Part Pages Service http:// /_vti_bin/webpartpages.asmx
Webs Service http:///_vti_bin/webs.asmx
The SharePoint web services only accept calls from existing SharePoint users and do also enforce access security. Import the System.Net namespace into your project and then use the NetworkCredential class to set the user credential to use for the web service call. Here is a code snippet:
public static XmlNode VersionsGetVersions(string SharePointHost, string UserName, string Password, string Domain, string FileName)
// proxy object to call the Versions web service
Versions.Versions VersionsService = new Versions.Versions();
// the user credentials to use
VersionsService.Credentials = new NetworkCredential(UserName, Password, Domain);
VersionsService.Url = SharePointHost + "_vti_bin/Versions.asmx";
// gets the file versions
XmlNode Result = VersionsService.GetVersions(FileName);
// dispose the web service object
If the user does not exist in SharePoint or does not have the permission to perform the operation then a WebException is thrown by SharePoint. The returned HTTP status is 401, which means unauthorized request
That's it. your job is done.
Share your SharePoint Experiences with us...
As good as the SharePointKings is, we want to make it even better. One of our most valuable sources of input for our Blog Posts comes from ever enthusiastic Visitors/Readers. We welcome every Visitor/Reader to contribute their experiences with SharePoint. It may be in the form of a code stub, snippet, any tips and trick or any crazy thing you have tried with SharePoint.
Send your Articles to email@example.com with your Profile Summary. We will Post them. The idea is to act as a bridge between you Readers!!!
If anyone would like to have their advertisement posted on this blog, please send us the requirement details to firstname.lastname@example.org