I have a following requirement
Requirement : "Create Site collection programatically on a web application which is hosted on a remote server and then create Sub site in it"
I am able to successfully create Site collection using Admin.asmx web service. But, for Sub sit when i use following code - it throws an exception "Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))"
Uri site = new Uri("http://SharePoint2010Site/");
string webServicePath = "_vti_bin/Sites.asmx";
string webServiceUrl = Path.Combine(site.AbsoluteUri, webServicePath);
Sites webService = new Sites();
webService.Credentials = CredentialCache.DefaultNetworkCredentials;
webService.Url = webServiceUrl;
//the following line creates the sub site
string result = webService.CreateWeb("Sub Site", "Sub Site", "Sub Site Desc", "STS#0",
1033, true, 1033, true, 1033, true, true, true, true, true, true, true);
What can be the reason for Access denied exception?