Do we need to disconnect from sharepoint? If Yes How?
I am using web services to access SharePoint list,sites and documents. Like: List.asmx,Site.asmx e.t.c.
My question is that:
Do we need to disconnect from SharePoint when using above services? And if yes then How?
Example:
GetSiteCollection(String login, String password, String url)
{
Webs ws = new Webs();
try
{
ws.Credentials = new NetworkCredential(login, password);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
ws.Url = url + @"/_vti_bin/webs.asmx";
ws.PreAuthenticate = true;
XmlNode websiteNode = ws.GetWebCollection();
XmlNodeList nodes = websiteNode.SelectNodes("*");
// getting list set of sites
//Now here after this is there any way to disconnect from server?
}
Webservices are disconnected by default, you communicate by sending and receiving messages, so there's no need to disconnect.
精彩评论