0
votes

I have a console application project which is a workflow service self hosted using WorkflowServiceHost. It contains a flowchart workflow definition (xaml) and some custom activities in cs files. This application connects (via a service reference) to a WCF data service hosted as .svc. I have an aspnet web app that interacts with the workflow service via a service ref. It's all working fine.

I'd like to convert the workflow service console app to instead be hosted on IIS (I'm developing using IIS5 and the live environment is IIS6) but am unsure how to go about it. I tried creating a WCF WorkflowService Application project and copying my xaml (changing to xamlx - not sure if I needed to do that or not) and cs files in, and created a service reference to my WCF data service but when I tried to browse the xamlx I got an error "Cannot create unknown type x" x being a type that it should be able to "see" via the service reference it has.

What are my options for hosting - do I have to use WorkflowServiceApplication or can I host using .svc? Can someone point to a tutorial or talk me through what I need to do? Also I would like to have the workflow definition in a class library project if possible, thus separating it from its host. Not critical though.

1
Ok, I think I have figured out the "type" problem, I built a new simplified .xamlx with just the initial receive and send reply using the type and the difference is that the namespace declaration is "clr-namespace:myproject.myserviceref;assembly=myproject;" whereas the console app didn't have the assembly definition.Nix
I can't seem to get this working with Windows Integrated authentication in IIS - getting the error "Security settings for this service require 'Anonymous' Authentication but it is not enabled for the IIS application that hosts this service." My WCF service is working using windows auth with "TransportCredentialOnly" so i tried setting my workflow's webconfig binding up in the same way but isn't working. Any ideas? Works fine with anonymous access ticked.Nix
Right - I've established that you only need minimal config on the service - a behavior that exposes the metadata and a workflowinstance store and it works. I got into trouble changing the config because my workflow didn't work from the WCFTestClient due to the test client's config using security mode "none". I still cannot get the WCFTestClient to work but all my other clients do work with Windows auth now because their configs are configured to use security mode = Transport. I'd like to know how to get WCFTestClient to work but I only use it for debug so it is not critical.Nix
I found a way to manually edit the WCFTestClient's config and then unticked the "Always regenerate config" option and it now works. I suspect that there ought to be a way to specify this in the WF service config but I'm not going to mess about with it again now that it works.Nix

1 Answers

0
votes

A XAML and XAMLX file are almost the same but not quite. The XAML file results in a class being generated to wrap the XAML and you work with that type as if it is a normal class. A XAMLX file is not compiled and parsed at runtime. The root element is also different for the two and the XAMLX has no x:Class attribute because it isn't compiled.

The easiest way is to just create a XAMLX file and copy the activities from the XAML file into the XAMLX file.