×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Error when call SharePoint API

Error when call SharePoint API

Error when call SharePoint API

(OP)
Hi,

I'm having an error when trying to create a new site with SharePoint API. The scenario is:

a) Custom SharePoint workflow calls b) Custom web service calls c) Class library in GAC

The error occur in the class library, the contentDb.Sites.Add throw an exception:
SPSecurity.RunWithElevatedPrivileges(delegate()
{   
newSite = contentDb.Sites.Add(newSiteName, newSiteTitle,
                newSiteDescription, nLCID, siteTemplate, ownerID,
                ownerName, ownerEmail);
});

Below is the exception information:
Windows Identity: serviceaccount001
Current Principal:
IsAuthenticated: False
WebMethodCall: CreateSiteCollection
Url: https://servername.domainname.com:89/SiteProvisionService/SiteProvisionService.asmx
ExceptionMessage: SoapException
System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Exception:
Object reference not set to an instance of an object.
Error at    at Microsoft.SharePoint.Utilities.SPUtility.ValidateFormDigest()
   at Microsoft.SharePoint.Administration.SPSiteCollection.Add(SPContentDatabase database, SPSiteSubscription siteSubscription, String siteUrl, String title, String description, UInt32 nLCID, String webTemplate, String ownerLogin, String ownerName, String ownerEmail, String secondaryContactLogin, String secondaryContactName, String secondaryContactEmail, String quotaTemplate, String sscRootWebUrl, Boolean useHostHeaderAsSiteName)
   at Microsoft.SharePoint.Administration.SPSiteCollection.Add(SPSiteSubscription siteSubscription, String siteUrl, String title, String description, UInt32 nLCID, String webTemplate, String ownerLogin, String ownerName, String ownerEmail, String secondaryContactLogin, String secondaryContactName, String secondaryContactEmail, Boolean useHostHeaderAsSiteName)
   at Microsoft.SharePoint.Administration.SPSiteCollection.Add(String siteUrl, String title, String description, UInt32 nLCID, String webTemplate, String ownerLogin, String ownerName, String ownerEmail)
   at EDS.kC.Provisioning.SiteProvisionClass.CreateSiteCollectionInContentDb(String newSiteName, String newSiteTitle, String newSiteDescription, UInt32 nLCID, String siteType, String ownerID, String ownerName, String ownerEmail, String secondaryOwnerID, String secondaryOwnerName, String secondaryEmail) in F:\...\SiteProvisionClass.cs:line 319
   at EDS.kC.Provisioning.SiteProvisionClass.CreateSiteCollectionInContentDb(String newSiteName, String newSiteTitle, String newSiteDescription, UInt32 nLCID, String siteType, String ownerID, String ownerName, String ownerEmail, String secondaryOwnerID, String secondaryOwnerName, String secondaryEmail) in F:\...\SiteProvisionClass.cs:line 411
   at EDS.SharePoint.Provisioning.SiteProvisionService.<>c__DisplayClass1.<CreateSiteCollection>b__0() in F:\...\SiteProvisionService\SiteProvisionService.asmx.cs:line 72
   at Microsoft.SharePoint.SPSecurity.<>c__DisplayClass4.<RunWithElevatedPrivileges>b__2()
   at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode)
   at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(WaitCallback secureCode, Object param)
   at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(CodeToRunElevated secureCode)
   at EDS.SharePoint.Provisioning.SiteProvisionService.CreateSiteCollection(String newSiteName, String newSiteTitle, String newSiteDescription, UInt32 nLCID, String siteType, String ownerID, String ownerName, String ownerEmail, String secondaryOwnerID, String secondaryOwnerName, String secondaryEmail) in F:\...\SiteProvisionService\SiteProvisionService.asmx.cs:line 65
   --- End of inner exception stack trace ---

If I direct reference the class library in the custom SharePoint workflow without the web service call, the code run successfully and did not throw any error.

Your help is greatly appreciated.

Thanks!
 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close