2010-02-11 33 views
0

我正在使用Web服務訪問SharePoint列表,網站和文檔。 贊:List.asmx,Site.asmx e.t.c.我們是否需要從Sharepoint斷開連接?如果是如何?

我的問題是:

我們需要從SharePoint斷開使用上述服務時? 如果是的話怎麼樣?

例子:

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? 

} 
+0

我不明白你想做什麼。你能更詳細地描述你需要什麼嗎? – jaloplo 2010-02-11 07:42:09

回答

3

Web服務在默認情況下斷開連接,您可以通過發送和接收消息進行通信,所以沒有必要斷開。

相關問題