Tag Archives: Taskcentre

BPA (Taskcentre) – “The operation has timed out” when calling a webservice multiple times

An issue I’ve had a few times in the past with regards BPA (formerly “Taskcentre) is the following error message in a specific scenario. The error is caused when a webservice is called multiple times. Usually the first 2 calls are called correctly, however when called a 3rd time, the error message is thrown.

Oddly, when debugging the issue, if you set BPA to use Fiddler to debug the issue, then the error does not happen.

The error message thrown is:

The operation has timed out .

As it doesnt fail on the first 2 calls, this will lead to errors such as:

Step failed, 3 web service calls complete, 1 call(s) failed

In addition the “Connection timeout time” setting on the web service connector is ignored:

To fix the issue, it is a very simple fix. Simply edit the “iwtskrun.exe.config” file, adding the following just before the closing </configuration> tag.

<add address="*" maxconnection="100" />

Server 2019 – Installing Legacy Software Requiring IIS 7

I’ve recently had an issue installing legacy software on Server 2019. This legacy software uses IIS 7 or newer.

Server 2019 comes with IIS version 10.

Unfortunately the installer could not pick up that a version newer than 7 was installed. This is due to how it checked the registry to find the version installed.

For fix this, I amended the following Registry value using RegEdit:


I changed the value from 10 to 9, ran the installation, then changed it back to 10 afterwards.

BPA Custom Message Body in Web Service Tool

Within BPA it is possible to add a custom message body. These are not in the documentation, but are very useful. These functions override the standard operation and allow you to modify the document before it is sent by POST.

(In the screenshot below, the word “TEST” appears before the XML generated as part of the input step.)

Operations need to be wrapped within Curly brackets.

A few examples:


The XML created from the input data.


The JSON created from the input data


Call the function “FunctionCall” passing in the XML Input Data.


The parameter “ParameterName”.

Multiple steps can be wrapped together too, for example:


This calls the “BuildRequest” function, passing in the XML, the text “CREATE” and the input parameter “APIKEY”. The output is wrote into the body of the message.

Mockbin and BPA (Formerly Taskcentre)

I use http://mockbin.org/ to test web service calls, and quite recently have been using it with BPA in order to test integrations when access to a live service is not available.

Recently I’ve had an issue with BPA not picking up MockBin correctly and completely ignoring the data which has been returned via the web service call.

After lots of head scratching, in order to fix this, I had to add the headers of “charset: utf-8”. After adding this, Mockbin works perfectly with BPA.

Example below:

  "status": 200,
  "statusText": "OK",
  "httpVersion": "HTTP/1.1",
  "headers": [
      "name": "Content-Type",
      "value": "application/xml"
      "name": "charset",
      "value": "utf-8"
  "cookies": [],
  "content": {
    "mimeType": "application/xml",
    "text": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<tests>\n<test>\n<status>Example</status>\n</test>\n</tests>",
    "size": 0
  "redirectURL": "",
  "bodySize": 0,
  "headersSize": 0

Taskcentre – Recording Success / Failure using “Call Task” Tool

The “Call Task” tool in Taskcentre is a useful tool in calling other tasks.

The task can run in two modes:

  • Synchronous
  • Queue

This adds the task to the queue, to be scheduled at a future point in time

This queues the task and awaits a response.

Sometimes in Taskcentre you wish to know if a task you have called has failed. This is useful in cases where there’s a queue of objects which require some work completing and you are processing these in a batch. Examples include:

  • Invoices to send
  • Sales Orders to process
  • Records require uploading to website
  • etc

The issue with calling tasks Synchronously is that you cannot easily tell if the task being run has failed or not, however by analysing the output of the task, you can record this information and make decisions accordingly.

Here’s the output of calling this task:

		<SupplementaryReference />
		<Folder>Tasks\Test\Looping options\</Folder>

The “TaskRunStatus” flag is the important part here. If the value is “2”, then the task completed successfully. Value “4” is a failure.

Using the “XML To RecordSet” tool, each results from the “Call Task” can be mapped to a Recordset:

From there, we can then use the “VBScript” tool to loop around all the RecordSet entries:

Here’s the VBScript:

If ThisStep.RecordSource("OutputData_TaskRunStatus") = 2 Then
  Variables("SuccessCount") = Variables("SuccessCount") + 1
  Variables("FailCount") = Variables("FailCount") + 1
End If

From there, you can use these variables within your other steps. For example, here’s a HTML document which is posted to HipChat using code here.

Variables("Message") = "<B>Task Completion</B>"
Variables("Message") = Variables("Message") & "<BR/>Success: " & Variables("SuccessCount")
Variables("Message") = Variables("Message") & "<BR/>Fail: " & Variables("FailCount")

SQL Remove Trailing Decimal Places

Within a recent project, I’ve been extracting data from Microsoft Dynamics NAV using Taskcentre.

Within NAV, decimals are stored as decimal(38,20), complete will all 20 decimal places..!

Dynamics NAV 20 Decimal Places

The following SQL query is very handy at removing the un-required decimal places (but keeping the accuracy of the data)

SELECT CONVERT(DOUBLE PRECISION, 1.99990000000000000000)
	,CONVERT(DOUBLE PRECISION, 2.00000000000000000000)
	,CONVERT(DOUBLE PRECISION, 3.00005077000000000000)

The results of the above query is:


SQL Reduce Number of Decimal Places

TaskCentre SQL Performance – One way to improve performance

When using the “ODBC” or “OLEDB” tools in TaskCentre, it may appear that a single query is executed on the database. In actual fact from trial and error, I have identified multiple queries are being called.

For example, if you run the following query (This query identifies all Item Ledger Entries, where the timestamp is odd):


SELECT TOP 1000 [Item No_]
	,[Posting Date]
FROM [dbo].[CRONUS UK Ltd_$Item Ledger Entry]
WHERE ([timestamp] % 2) <> 0

Notice, that the transaction isolation level is READ UNCOMMITTED. This means that the query will read the dirty data and not block other users. Also it is limited to 1000 rows.

However when the task is running, it appears that the following SQL queries are run against the database:


SELECT TOP 1000 [Item No_]
	,[Posting Date]
FROM [dbo].[CRONUS UK Ltd_$Item Ledger Entry]
WHERE ([timestamp] % 2) <> 0


FROM [dbo].[CRONUS UK Ltd_$Item Ledger Entry]
WHERE ([timestamp] % 2) <> 0

The first query returns the data, the 2nd query returns the number of rows.

Notice in the 2nd query, the transaction isolation level is not declared… (In this case, will cause blocking). Also the TOP statement has been removed too, meaning that all records are counted – not good especially when there is a complex filter such as the above which can be time consuming.


A solution for this is to disable the counting of the records. One way I have identified how to do this is to UNION to a table returning no rows. (As obviously you don’t want to return rows to corrupt your SQL query).

In this example:


SELECT TOP 1000 [Item No_]
	,[Posting Date]
FROM [dbo].[CRONUS UK Ltd_$Item Ledger Entry]
WHERE ([timestamp] % 2) <> 0

I’ve identified that when UNION is used, Taskcentre does not count the number of records. This means that if you are using the data, the “RowCount” will return -1 instead of the actual data. If you need this for a further step (such as a decision), then you have to calculate it by looping round in VB as per this knowledgebase article.

Note and Disclaimer:
I don’t have knowledge of how the software actually works internally, so this document is only based on my experience and investigation, so is provided as-is.

Selecting Text Between Characters in Taskcentre – Using VB Script

In Taskcentre, the text parser tool can be used to extract text between set characters.

A good example is if you have the following input data:

<Result>This is a test</Result>

And wish to extract the following text:

This is a test

Select String Between Characters Using VBScript in TaskcentreThis is a good tool, however doesn’t handle errors very well. For example, if the text is not found, it will throw an error message (unless you tell it to ignore errors), which may impact other steps. Additionally the extracted string may be needed in the middle of a Web Service call.

A solution is to use a VBScript function which will handle these errors gracefully. In the example, the function will return a space character if either of the characters are not found. but this can be changed to anything, e.g. “Error”, “String not Found” etc within the function

Using the function is very simple. The screenshot below shows example code:
Select String Between Characters Using VBScript in Taskcentre - Usage

In the example, the variable Result1 will be set to “This is a test”, whereas Result2 is not found, so is set to a space character.

Full download of the example is available below:
Select String Between Characters Example Script and Task

Automating E-Mail Support Requests using FOAAS and Taskcentre

In this day and age, everyone is looking for prompt responses to e-mails and support requests. In this blog post I’m going to cover integrating FOAAS into e-mail using Taskcentre in order to provide prompt responses to support requests.

By responding quickly to emails, it can greatly improve satisfaction levels, plus also using FOAAS’s technology can also reduce the number of support requests*.

* by increasing the likelyhood of a P45.

In order to integrate the solution, we need to break it down into 3 major steps:

  • Intercept Email
  • Call Web Service
  • Send Response

Intercept E-Mail
FOAAS - Intercept E-MailIn order to intercept the email, we use a standard “SMTP” input trigger. This trigger stores the following into variables:

  • From E-Mail
  • E-Mail Subject
  • E-Mail Body

Additionally, we also need to use the “Text Parser” tool in order to extract the following from the “From E-Mail”

  • Sender Name
  • Sender E-Mail

Call Webservice
FOAAS - Web Service CallFOAAS is a REST based webservice. So I’ve built up a web service call, passing through the following parameters:

  • Sender Name
  • From Name

This web service returns two values:

  • message
  • subtitle

Additionally, the web service requires custom headers which have been amended using the tool

Send Response
FOAAS - Send ResponseA response is then sent to the inbound e-mail automatically, using the following steps:

  1. XML to Recordset (HTML Tool only recognises recordsets)
  2. HTML (To build up an email)
  3. Outbound SMTP

Below you can see an inbound email from a used. As you can see, the email contains both a subject and a request for the support helpdesk. In my VM, the “From” name is “James – Demonstration”, as I use the VM for testing and demonstration purposes.
FOAAS - Inbound E-Mail

Here is the response to the email, including the automated response to the web service:
FOAAS - Outbound E-Mail

Source Task and Installation
Below is the download link for the example, plus also the web service connector. In order to install the task, the install needs to be done in the following order:

  1. Import Web Services Connector
  2. Import Task

FOAAS Web Service Connector

This task has been provided for humour/educational use only.