Tag Archives: BPA

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.

<system.net>
<connectionManagement>
<add address="*" maxconnection="100" />
</connectionManagement>
</system.net>

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:

{=ThisOperation.XML}

The XML created from the input data.

{=ThisOperation.JSON}

The JSON created from the input data

{=FunctionCall(ThisOperation.XML)}

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

{=ThisOperation.Parameters(“ParameterName”)}

The parameter “ParameterName”.

Multiple steps can be wrapped together too, for example:

{=BuildRequest(ThisOperation.XML,”CREATE”,ThisOperation.Parameters(“APIKEY”))}

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
}