views:

27

answers:

1

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 programatically or what?

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

All advise is welcomed.

Thanks

A: 

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

Vladi Gubler