开发者

Programmatically accessing a PKI sharepoint portal

I am having trouble doing something simple like the following

using (SPSite site = new SPSite(topLevelSite))
{
   SPWeb rootWeb = site.OpenWeb();
   SPWeb newWeb = rootWeb.Webs.Add(siteName, "abc", "abc",1033,template,false,false);
}

But the catch I am trying to add a site to a PKI enabled sharepoint site:

This code works fine when I am dealing with my non pki sharep开发者_StackOverflowoint server, but I get the error:

" The Web Application at https://server/sites/newSite could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system admin may need to add a new request URL mapping to the intended application. "

My main question is: How do you go about accessing with C# a sharepoint site that is PKI enabled? Do I need to insert my certs somewhere programmatically or what?

Are there steps before I open SPSite, or are there other Objects I need to use that are more PKI friendly?


I would first make sure that the URL you use is the same URL SharePoint itself knows about. This thing is called Alternate Access Mapping and is accessible through the Central Administration. Sometimes people would map the web application to a different URL using DNS and IIS configuration only, without updating SharePoint itself. It might appear to be working correctly when browsing the site, but this kind of error would appear when using the API

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜