SPServices CreateWeb

Feb 27, 2013 at 2:08 PM
Edited Mar 1, 2013 at 1:28 PM
Hi,
I'm using CreateWeb in the content editor web part
i saw the other post about CreateWeb and had made the change according to that post
but i got some different problem.
Here is code:

     <script src="https://pmev2.bah.com/sites/EPMIII/JavaScripts/jquery-1.8.3.js"> </script>
<script src="https://pmev2.bah.com/sites/EPMIII/JavaScripts/jquery.SPServices-2013.01ALPHA1.js"> </script>


<script type="text/javascript" language="javascript">  

   $(document).ready(function() {  

     //alert("jQuery");  

     
     $("#createTTO").click(function()
     {
       //alert($().SPServices.SPGetCurrentSite()); 
       var siteName = $("#siteName").val();
       var siteUrl = "https://sharepoint.com/sites/TestSites/test/";
       var siteTitle =$("#siteTitle").val();
       var siteDesc =$("#siteDesc").val();

       $().SPServices({
       operation:"CreateWeb",
       url:siteUrl,
       title:siteTitle,
       description:siteDesc,
       templateName:"TestTemplate.stp",
       language:1033,
       languageSpecified:true,
       locale:1033,
       localeSpecified:true,
       collationLocale:1033,
       collationLocaleSpecified:true,
       uniquePermissions:false,
       uniquePermissionsSpecified:false,
       anonymous:false,
       anonymousSpecified:false,
       presence:false,
       presenceSpecified:false,
       async:false,
       completefunc:function (xData, Status){
       alert(xData.responseText);
       console.log(xData.responseText)       }   
        
       });

      });


   });  

 </script> 

Site Name: <input type="text" id="siteName" name="siteName"></br>
Site Title:<input type="text" id="siteTitle" name="siteTitle"></br>
Site Description <input type="text" id="siteDesc" name="siteDesc">

<input type="button" id="createStie" name="createBotton" value="Create Site" >
i got this warning from xdata.responseText:
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><faultcode>soap:Client</faultcode><faultstring>Server did not recognize the value of HTTP Header SOAPAction: http://schemas.microsoft.com/sharepoint/soap/CreateWeb.</faultstring><detail />
</soap:Fault>
</soap:Body>
</soap:Envelope>

and site is not created
please help.
Coordinator
Feb 28, 2013 at 7:40 PM
I think I have a bug in the Sites Web Service implementation in SPServices. I'm looking into it...

M.
Coordinator
Feb 28, 2013 at 7:49 PM
I knew it sounded familiar: http://spservices.codeplex.com/workitem/10114

I'm going to post the first alpha of the next release shortly. It has a fix.

M.
Mar 1, 2013 at 1:32 PM
Hi,

i edit my post and add complete code

i downloaded SPServices 2013.01, and use it in the code

but it didn't fix the problem i have, it still giving the same warning message

Thanks,
Mar 1, 2013 at 1:48 PM
Hi,

i edit my post and add complete code

i downloaded SPServices 2013.01, and use it in the code

but it didn't fix the problem i have, it still giving the same warning message

Thanks,
Coordinator
Mar 1, 2013 at 2:03 PM
Are you running SharePoint 2007? The CreateWeb operation isn't available in 2007, but is in 2010.

Note the two MSDN links here:
http://spservices.codeplex.com/wikipage?title=$().SPServices

M.
Mar 1, 2013 at 3:27 PM
.... i was running SharePoint 2007

Thanks for the help, i should do more reading before i post.
Oct 30, 2013 at 8:27 PM
Hi Marc,

I got this working but im wondering if there's any way to set settings like: Show in quick launch, inherit top link bar, display link in top link, etc. Basically the same issue we had with new Lists where we had to run an update to set those properties.