Custom Tracking service in app.config, Web.config web service workflow
I want my workflow exposed as a web service to use my custom tracking service (that extends TrackingService). I am a relative newbie to WF, and Im using VS2005.
I am just guessing right now, but I thought I could do the following in my app.config:
<
configuration><
configSections><
section name="WorkflowRuntimeConfig" type="System.Workflow.Runtime.Configuration.WorkflowRuntimeSection, System.Workflow.Runtime, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/><
section name="LocalServicesConfig" type="System.Workflow.Runtime.ServiceSection, System.Workflow.Runtime, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/></
configSections><
WorkflowRuntimeConfig><
Services><add type="System.Workflow.Runtime.Hosting.ManualWorkflowSchedulerService, System.Workflow.Runtime, Version=3.0.00000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</Services>
</WorkflowRuntimeConfig>
<LocalServicesConfig>
<Services>
<add type="PersonServiceWorkflow.PersonTrackingService, PersonServiceWorkflow, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
</Services>
</LocalServicesConfig>
</configuration>
I use the "Publish as Web Service" option to generate my WS and Web.config file:
<?
xml version="1.0"?><!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<
configuration><
configSections><
section name="WorkflowRuntime" type="System.Workflow.Runtime.Configuration.WorkflowRuntimeSection, System.Workflow.Runtime, Version=3.0.00000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/></
configSections><
WorkflowRuntime Name="WorkflowServiceContainer"><
Services><
add type="System.Workflow.Runtime.Hosting.ManualWorkflowSchedulerService, System.Workflow.Runtime, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/><
add type="System.Workflow.Runtime.Hosting.DefaultWorkflowCommitWorkBatchService, System.Workflow.Runtime, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/></
Services></
WorkflowRuntime><
appSettings/><
connectionStrings/><
system.web><!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
--><
compilation debug="false"><
assemblies><
add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/><
add assembly="System.Drawing.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/><
add assembly="System.Transactions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/><
add assembly="System.Workflow.Activities, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/><
add assembly="System.Workflow.ComponentModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/><
add assembly="System.Workflow.Runtime, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/><
add assembly="Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/><
add assembly="System.Messaging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/><
add assembly="System.Runtime.Remoting, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/><
add assembly="System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/><
add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/><
add assembly="Microsoft.Build.Utilities, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/><
add assembly="Microsoft.Build.Framework, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/></assemblies></compilation><!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
--><
authentication mode="Windows"/><!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm"/>
<error statusCode="404" redirect="FileNotFound.htm"/>
</customErrors>
--><
httpModules><
add type="System.Workflow.Runtime.Hosting.WorkflowWebHostingModule, System.Workflow.Runtime, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="WorkflowHost"/></
httpModules></
system.web></
configuration>What do I need to modify in app.config or Web.config so that the WorkflowRuntime utilizes my PersonTrackingService (ie. call this.TrackData(string) server side)?
Thanks
Chris
Answers
In either web.config or app.config you want to put the <add> node for your PersonTrackingService in the same <Services> node as the <add> node for the ManualWorkflowSchedulerService:
<configuration>
<configSections>
<section name="WorkflowRuntime" type="System.Workflow.Runtime.Configuration.WorkflowRuntimeSection, System.Workflow.Runtime, Version=3.0.00000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</configSections>
<WorkflowRuntime Name="WorkflowServiceContainer">
<Services>
<add type="System.Workflow.Runtime.Hosting.ManualWorkflowSchedulerService, System.Workflow.Runtime, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add type="System.Workflow.Runtime.Hosting.DefaultWorkflowCommitWorkBatchService, System.Workflow.Runtime, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add type="PersonServiceWorkflow.PersonTrackingService, PersonServiceWorkflow, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
</Services>
</WorkflowRuntime>
<appSettings/>
<connectionStrings/>
<system.web>
.....
Thanks,
Joel West
MSFTE - SDE in WF runtime and hostingThis posting is provided "AS IS" with no warranties, and confers no rights
All Replies
Chris, I believe you need to add the ExternalDataExchangeService to your list of workflow services:
<add type="System.Workflow.Activities.ExternalDataExchangeService, System.Workflow.Activities, Version=3.0.00000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" ConfigurationSection="LocalServicesConfig"/>
Note the additional ConfigurationSection attribute at the end.
In either web.config or app.config you want to put the <add> node for your PersonTrackingService in the same <Services> node as the <add> node for the ManualWorkflowSchedulerService:
<configuration>
<configSections>
<section name="WorkflowRuntime" type="System.Workflow.Runtime.Configuration.WorkflowRuntimeSection, System.Workflow.Runtime, Version=3.0.00000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</configSections>
<WorkflowRuntime Name="WorkflowServiceContainer">
<Services>
<add type="System.Workflow.Runtime.Hosting.ManualWorkflowSchedulerService, System.Workflow.Runtime, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add type="System.Workflow.Runtime.Hosting.DefaultWorkflowCommitWorkBatchService, System.Workflow.Runtime, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add type="PersonServiceWorkflow.PersonTrackingService, PersonServiceWorkflow, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
</Services>
</WorkflowRuntime>
<appSettings/>
<connectionStrings/>
<system.web>
.....
Thanks,
Joel West
MSFTE - SDE in WF runtime and hostingThis posting is provided "AS IS" with no warranties, and confers no rights
Thank you Joel. That was it, plus a few other hoops - I was getting a soap exception when it tried to load PersonTrackerService, then again on a framework call to getProfile. I had to re-deploy as a webservice then all was fine.
Is there detailed documentation on this that Im missing?
Thanks again,
Chris
Documentation on the configuration files is in our latest internal doc build ("configuration files" in the index). Not sure if it is there in the current public builds, I don't have a diff (documenation work is still in progress). Should be available in the RTM build though or soon after in the online help.
Thanks,
Joel West
MSFTE - SDE in WF runtime and hostingThis posting is provided "AS IS" with no warranties, and confers no rights

