以编程方式访问 PKI 共享点门户
我在执行如下简单操作时遇到问题
using (SPSite site = new SPSite(topLevelSite))
{
SPWeb rootWeb = site.OpenWeb();
SPWeb newWeb = rootWeb.Webs.Add(siteName, "abc", "abc",1033,template,false,false);
}
但问题是我试图将站点添加到启用 PKI 的共享点站点:
当我处理非 pki 共享点服务器时,此代码工作正常,但出现错误:
” 找不到 https://server/sites/newSite 处的 Web 应用程序。验证您输入的 URL 是否正确。如果 URL 应该为现有内容提供服务,系统管理员可能需要添加新的请求 URL 映射到预期的应用程序。 ”
我的主要问题是:如何使用 C# 访问启用了 PKI 的共享点站点?我需要以编程方式在某处插入我的证书吗?
在打开 SPSite 之前是否有步骤,或者是否需要其他对象使用哪个对 PKI 更友好?
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 sharepoint 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我首先要确保您使用的 URL 与 SharePoint 本身知道的 URL 相同。这个东西称为备用访问映射,可以通过中央管理访问。有时,人们会仅使用 DNS 和 IIS 配置将 Web 应用程序映射到不同的 URL,而不更新 SharePoint 本身。浏览网站时可能看起来工作正常,但使用 API 时会出现这种错误
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