2010-11-03 53 views
1

我有一個clearQuest Web(在Linux上運行),並且希望在創建新記錄(使用perl腳本)時創建一個SharePoint站點。 我該怎麼做 - 是否有任何可用於創建網站的SharePoint Web服務。 我相信我需要一個Perl Web服務的模塊,我該如何將它添加到clearQuest Web服務器的perl安裝中?從clearQuest Web服務器創建SharePoint站點

有沒有人用這個過濾過?

回答

0

我沒有使用perl腳本。但檢查出http://sharepoint site/_vti_bin/sites.asmx webservice。這個webservice可以用來管理網站。

0

我創建了一個用於在SharePoint(WSS 3)中創建網站的自定義Web服務,因爲我找不到使用現有Web服務執行此操作的方法。

的代碼看起來是這樣的:

[WebService(Namespace = "http://tempuri.org/")] 
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] 
public class CreateSiteWebService : System.Web.Services.WebService 
{ 

    [WebMethod] 
    public string CreateSite(
      string strWebUrl, 
      string strTitle, 
      string strDescription, 
      uint nLCID, 
      string strWebTemplate, 
      bool useUniquePermissions, 
      bool bConvertIfThere 
     ) 

    { 
     SPWeb newWeb = null; 
     SPSite site = SPContext.Current.Site; 
     newWeb = site.RootWeb.Webs.Add(strWebUrl, strTitle, strDescription, nLCID, strWebTemplate, useUniquePermissions, bConvertIfThere); 
     newWeb.Navigation.UseShared = true; 
     newWeb.Update(); 
     //try to get it to appear in quick launch: 
     SPNavigationNodeCollection nodes = web.Navigation.QuickLaunch; 
     SPNavigationNode menuNode = null; 
     foreach(SPNavigationNode n in nodes) 
     { 
      if (n.Title == "Sites") 
      { 
       menuNode = n; 
       break; 
      } 
     } 
     if (menuNode == null) 
     { 
      menuNode = new SPNavigationNode("Sites", site.Url + "/_layouts/viewlsts.aspx?ShowSites=1", false); 
      nodes.AddAsFirst(menuNode); 
     } 
     SPNavigationNode navNode = new SPNavigationNode(strTitle, strWebUrl, false); 
     menuNode.Children.AddAsLast(navNode); 
     parent.Update(); 
     parent.Dispose(); 

     site.Dispose(); 
     string url = newWeb.Url; 
     newWeb.Dispose(); 
     return url; 
    } 
} 

希望有所幫助。