在 Sharepoint 工作流中使用 ReceiveActivity
我已经在 sharepoint 中创建了第一个小工作流程,并且尝试使用 ReceiveActivity 从外部访问它。我创建了一个 WCF svc 文件
并在 IIS 中创建一个网站,其应用程序池与共享点网站相同。
现在我可以从 doclib 启动工作流,但是当我尝试访问如下所示的 ReceiveActivity 时,出现以下错误:“工作流托管环境没有工作流实例上的操作所需的持久性服务”。
我认为这与我自己的 WCF 网站中没有使用 Sharepoint 持久性服务有关,但我不确定。关于这个有什么想法吗???
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);
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
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);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否创建了托管工作流的 SQL 表?位于 C:\Windows\Microsoft.NET\Framework\v3.0\Windows Workflow Foundation\SQL\en 的?如果您这样做了,您现在需要将所需的标记添加到您的配置(在本例中为包含 svc 文件的 WCF 文件夹),如下所述 位于 msdn。
评论后编辑:尝试在代码中运行持久性服务:
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: