views:

52

answers:

1

Hi,

I've made my first little workflow in sharepoint and I am trying to access it from the outside using a ReceiveActivity. I have created a WCF svc file with

<%@ ServiceHost Debug="true" Factory="System.ServiceModel.Activation.WorkflowServiceHostFactory" Service="SharePointWorkflow.MyWorkflow, SharePointWorkflow, Version=1.0.0.0, Culture=neutral, PublicKeyToken=4507db3165e051fd" %>

and created a website in IIS with the same application pool as the sharepoint site.

Now I can start the workflow from my doclib, but when I try to reach the ReceiveActivity like below, I get the following error: "the workflow hosting environment does not have a persistence service as required by an operation on the workflow instance".

I think it has something to do with not using the Sharepoint persistence service in my own WCF website, but I'm not sure. Any idea's on this one???

DoMyThingContractClient proxy = new DoMyThingContractClient ();

IContextManager contextManager = proxy.InnerChannel.GetProperty<IContextManager>();

IDictionary<string, string> context = contextManager.GetContext();
context.Add("instanceId", myInstanceId);
contextManager.SetContext(context);

result = proxy.GetMyMethod(tb1.Text, tb2.Text);
A: 

Have you created the SQL tables that host the workflows? The ones at C:\Windows\Microsoft.NET\Framework\v3.0\Windows Workflow Foundation\SQL\en? If you did, you now need to add the required tags to your config (your WCF's folder with the svc file in this case) as explained at msdn.

Edit after comments: try to run a Persistance Service in your code:

SqlWorkflowPersistenceService ps = new SqlWorkflowPersistenceService("Initial Catalog=SqlPersistenceService;Data Source=localhost;Integrated Security=SSPI");
currentWorkflowRuntime.AddService(ps);
F.Aquino
Hi, No I did not create those tables, because sharepoint hosts the workflow and not my own application. Sharepoint has it own persistence service, so it does not make sense to me to do so. The workflow works fine within sharepoint (including persistence), I just can't get the ReceiveActivity to work.Bart
Bart