Geeks With Blogs
Molnar Tibor blog

There is the following complex scenario: a workflow hosted in MOSS is listening in an OnTaskChanged activity which is in a While loop. The task change could happen if a user enters MOSS and manually updates the task (i.e. completes it) or by an external console application, which programatically looks up and alters the task. In the Invoked event handler of the OnTaskChanged activity a web service is called to obtain information which used to proceed further. The web service uses integrated authentication.

The second way doesn't works by default. When the SPWorkflowTask.AlterTask method is called, a new thread is strated by the MOSS API in the process of the console application, having
for the System.Threading.Thread.CurrentPrincipal.Identity the following attribute values: AuthenticationType = "", IsAuthenticated = False, Name = "", type = System.Security.Principal.GenericIdentity. This means that the Windows identity of the process is not used to set the principal of this thread. When accessing the web service, an HTTP unauthorised error code is returned.

Trying to set the network credentials of the web service proxy doesn't helps, the unauthorised error code persists.

The solution: impersonate the thread using a valid Windows account which will pass the integrated authentication.

Posted on Tuesday, December 11, 2007 10:57 AM SharePoint 2007 | Back to top

Comments on this post: Calling a web service from a Workflow hosted in MOSS, listening in an UpdateTask activity and beeing invoked by using AlterTask from external application

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © Molnar Tibor | Powered by: