0

I have a custom built web service that is built to simply add items into a list in SharePoint Foundation 2010. I have workflow attached to the list but when I create an item using my web service (which references the SharePoint Object Model) workflows 'Fail on Start'. If I add an item to the list directly within SharePoint the workflows start as required with no problems. I have tried the following so far (including all variations of using them together) but non of these fix the issue:

  • Using SPSecurity.RunWithElevatedPrivilages to run my code
  • Impersonating a different user to the Administrator and System Account to create the item as
  • Running my application pool as the same user as my site's application pool
  • Running my application pool as a different account to my site's application pool user The web service is not failing and it is creating the items, just the workflows are not running... can anyone help me with this please?

After looking in the logs, it would appear the error on the workflow is as follows:

Microsoft.SharePoint.SPException: at Microsoft.SharePoint.Workflow.SPNoCodeXomlCompiler.LoadXomlAssembly(SPWorkflowAssociation association, SPWeb web) at Microsoft.SharePoint.Workflow.SPWinOeHostServices.LoadDeclarativeAssembly(SPWorkflowAssociation association) at Microsoft.SharePoint.Workflow.SPWinOeHostServices.CreateInstance(SPWorkflow workflow) at Microsoft.SharePoint.Workflow.SPWinOeEngine.RunWorkflow(SPWorkflowHostService host, SPWorkflow workflow, Collection1 events, TimeSpan timeOut) at Microsoft.SharePoint.Workflow.SPWorkflowManager.RunWorkflowElev(SPWorkflow workflow, Collection1 events, SPWorkflowRunOptionsInternal runOptions)

Thanks in advance...

3
  • The real error message must be logged in SharePoint log. In such cases it typically has something like "Workflow Infrastructure" as error source. Can you find this error and post details here?
    – Alex Boev
    Feb 20, 2012 at 9:52
  • 1
    Is it the whole error message text? In SharePoint log the message may be splitted between multiple lines of log entries. I don't see the actual error message text - it's only a stack.
    – Alex Boev
    Feb 20, 2012 at 10:20
  • @AlexBoev - Thanks for pushing me into the logs, I found the resolution (see answer below).
    – Luke
    Feb 20, 2012 at 10:26

1 Answer 1

1

After researching the ULS log errors I found the issue was with my web.config file on my Web Service that needed the Authorized types declaring for the workflows to be able to run on the item I had created.

I used this post to help me resolve it: http://social.msdn.microsoft.com/forums/en-US/sharepointworkflow/thread/71d23c0e-24c5-4d61-8d62-265c374ac81c/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.