Accessing the View Flow URL with the WCF service
The View Flow URL can be accessed through the WCF service
URI
[WORKSPACE BASE URL]/K2Services/WCF.svc
Setup
Follow the steps below to set up an example for accessing the View Flow URL:
-
Open the URL :
-
The following page will open
- Copy the URL and Open K2 Designer for Visual Studio
- Create a new C# Console Application
-
In the Solution Explorer right click on the References Node and select Add Service Reference:
- In the Address paste the URL and click on Go
-
Change the Namespace to WCF and click OK :
-
Type the following code in the Static void Main(string[] args) method
WCF.ProcessNavigationServiceClient client = new WCF.ProcessNavigationServiceClient();
WCF.ProcessInstance pi = client.OpenProcessInstance("1", true, true); //change the "1" to your process instance
Console.WriteLine(pi.ViewFlow);
Console.Read();Change the “1” to your process instance ID number
- Run the console application
-
The View Flow URL is returned
Troubleshooting
If you receive the following error, you will have to update the web.config

Follow the steps below to update the web.config
- Open the web.config in the following location : C:\Program Files (x86)\K2 blackpearl\WebServices\K2Services
-
Search for the following XML:
<basicHttpBinding>
<!-- HTTP binding for WCF.svc endpoints -->
<!-- Ensure the WCF.svc endpoints are enabled when enabling these bindings -->
<binding name="SourceCode.Services.WcfBinding+HTTP">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="None" />
</security>
</binding>
<!-- HTTPS binding for WCF.svc endpoints -->
<!-- Ensure the WCF.svc endpoints are enabled and SSL in IIS is configured when enabling these bindings
<binding name="SourceCode.Services.WcfBinding+HTTPS">
<security mode="Transport">
<transport clientCredentialType="Windows" />
</security>
</binding>
-->
<!-- HTTP binding for SyncWCF.svc endpoints -->
<!-- WARNING: Basic over HTTP is inherently insecure -->
<!-- Ensure the SyncWCF.svc endpoints are enabled when enabling this binding
<binding name="SourceCode.Services.SyncWcfBinding+HTTP">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="None" />
</security>
</binding> -
Change the highlighted “None” to “Windows”
<basicHttpBinding>
<!-- HTTP binding for WCF.svc endpoints -->
<!-- Ensure the WCF.svc endpoints are enabled when enabling these bindings -->
<binding name="SourceCode.Services.WcfBinding+HTTP">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Windows" />
</security>
</binding>
<!-- HTTPS binding for WCF.svc endpoints -->
<!-- Ensure the WCF.svc endpoints are enabled and SSL in IIS is configured when enabling these bindings
<binding name="SourceCode.Services.WcfBinding+HTTPS">
<security mode="Transport">
<transport clientCredentialType="Windows" />
</security>
</binding>
-->
<!-- HTTP binding for SyncWCF.svc endpoints -->
<!-- WARNING: Basic over HTTP is inherently insecure -->
<!-- Ensure the SyncWCF.svc endpoints are enabled when enabling this binding
<binding name="SourceCode.Services.SyncWcfBinding+HTTP">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="None" />
</security>
</binding> -
Save the file, re-open your console application, right click on your service reference and click on Update Service Reference:
- Run the console application again