Legacy Modernization

(1 review)

home

Illustrates how to automate communication between a legacy system and a Web service which accepts HTTP requests. Mule "front-ends" the legacy system – which only accepts input via a file – so as to prepare data from an HTTP web service to a format that the legacy system accepts. To demonstrate these capabilities, this example adopts the use case of a legacy fulfillment system that must adapt to accept orders via an HTTP request. You can think of this example as an application that acts as a web service proxy for a legacy, file-based system.

Legacy Modernization

An older, legacy system may be limited in the form of data that it accepts. For example, an older system may only accept input as a file or via FTP. To update such a system so that it accepts more modern input formats, such as web service calls, Mule can sit in front of a legacy system, converting HTTP requests, for example, to strings. This conversion activity effectively modernizes the legacy system so that it accepts HTTP requests.

495a4640-LegacyModernization.png

Prerequisites

This document assumes that you are familiar with Mule Runtime, Anypoint Studio, Mule flows, SOAP Web services and using DataWeave in Anypoint Studio.

Example Use Case

This example demonstrates legacy system modernization within the context of a simple use case.

An organization uses an old fulfillment system which only accepts orders in flat file format. However, the company wants to begin accepting orders using a SOAP web service and automatically submit the orders to the legacy system for fulfillment. To process orders, the company uses Mule to convert HTTP requests into a file format that the legacy system accepts.

Set Up and Run the Example

Complete the following procedure to create and run this example in Anypoint Studio. You can create template applications straight out of the box in Studio and tweak the configurations of this use case-based template to create your own customized applications in Mule.

Skip ahead to the next section if you prefer to simply examine this example code snippets.

  1. Open the Example project in Anypoint Studio from Exchange. In the Package Explorer pane in Studio, right-click the project name and select Run As > Mule Application. Studio runs the application and Mule is up and kicking!
  2. To simulate a request submission to the Mule application, use the soapUI interface available for free download at www.soapui.org. This tool enables you to submit a request to simulate the submission of a new order in this example's use case. If you haven't already done so, download and launch soapUI.
  3. In soapUI, select File > Import Project. Browse to the AnypointStudio folder on your local drive to locate the sample soapUI project file: AnypointStudio > workspace > Legacy Modernization > src > main > resources > LegacyModernizationExample-soapui-project.xml. Click Open.
  4. In the new LegacyModernizationExample project in soapUI, expand the folders to reveal Request 1. Double-click Request 1 to open the request-response window.
  5. Click the green submit request icon to submit the request to the Mule application. soapUI displays the response from the Mule application in the response pane.
  6. Review the contents of the SOAP response, to examine the details of your processed request. Note, in particular, the orderReceivedStatus with the value "true".
  7. The order you submit via soapUI appears as a new ShippingOrder flat file in ${file.path}; note the date and time stamp of the new order. Double-click the flat file to open it and examine the contents.

How it Works

Using a single flow, this application exposes a SOAP Web service which accepts new order requests from customers. Asynchronously (relative to the HTTP request-response activity), the application uses a DataWeave transformer to map data from the shipping order POJO into a CSV file, which it sends to the legacy system for fulfillment. In this example, since there is no actual legacy system to perform order fulfillment, the File endpoint at the end of the flow simply outputs the CSV file to ${file.path} folder.

Notes:

  • This application uses APIkit for SOAP.
  • DataWeave transforms and maps data from POJO to CSV in one step. Click Preview to examine the CSV output that the DataWeave transformer produces when the application processes orders.

Reviews

TypeExample
OrganizationMuleSoft
Published by
MuleSoft Organization
Published onSep 6, 2018
Asset overview

Asset versions for 2.1.x

Asset versions
VersionActions
2.1.4
2.1.3
2.1.2

Categories

Functions
Enterprise ITNo values left to add
Difficulty
AverageNo values left to add