39498: MassTransit Launch Process and Web Service Integration

Translate to:

Applies to:

Summary:

This article describes how to trigger notifications from MassTransit to an external web service. The sample code contains a simple demo implementation, combining the MassTransit Launch Process Action with a Python script, wherein a SOAP client makes a call to an external web service.

For information on how to trigger notifications from MassTransit 7 to an external web service, please refer to Launch Process Action and Web Service Integration page.

Description:

When integrating MassTransit into a workflow, it might be necessary to notify an external program or web service when certain MassTransit actions occur. For detailed information on the MassTransit Actions feature, see the MassTransit manual.

Actions may be configured to launch an external process on the action trigger. This can be a script or executable program. In this demo, it is a Python script that can run on either Mac or Windows. For full information on Launch Process actions, including the environment variables and command line arguments available, see the Launch Process Actions KB article.

Within the Python script, a SOAP client is created and establishes a connection to a web service. In the demo, a sample SOAP server is provided that will run within an MTWeb environment. This SOAP server contains a method that will write a text file with file information that is passed to it from the SOAP client.

So for example, if the MassTransit Action is "After Files Are Added," when a file is added To Send for a particular contact, the Python script is launched as a separate process from MassTransit. When the script is launched, the database IDs of all the files in the action are passed as a command line argument. The Python script looks up information in the MassTransit database based on the database file IDs, then makes a SOAP call to the provided sample SOAP server, passing along the file information it looked up in the database. When the SOAP server is called, it takes in the file information and writes it to a file. This demonstrates how to get information about a particular MassTransit action to an external service or program.

Detailed setup and execution instructions are in the archive's README.txt file.

Related Document:

Tags: 

You are reporting a typo in the following text:
Simply click the "Send typo report" button to complete the report. You can also include a comment.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
5 + 0 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.