2010-11-03 46 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; 
    } 
} 

希望有所帮助。

相关问题