In SharePoint 2010, there is a new method CreateWeb in the Sites web service with the purpose to create new SharePoint sub sites. There are, however, a lot of issues with it - well, that is my experience at least. Here is the code that should utilize the web service and its method properly:
Uri site = new Uri("http://sp2010site/");
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("newsite", "New Site", "Site desc", "STS#0",
1033, true, 1033, true, 1033, true, true, true, true, true, true, true);
The following code returns Soap exception if something wrong happened (e.g. a sub site with the address "newsite" already exists, or the specified template doesn't exist).
If everything is ok, an InvalidOperation exception is fired with the message "There is an error in XML document (1, 310).", but the site is actually created!
If everything is ok, but I use my own solution instead of the non-default SharePoint template (such as the Team site, i.e. STS#0), I get a Soap exception and the site does not get created.
This has been a terrible experience so far. Please post your experiences with the sub site creation in SP 2010, and even better, post your resolutions to these problems if you have any. Cheers all!