This document summarizes a Mule application that demonstrates how to modernize a legacy system by automating communication between the legacy system and a web service. The application exposes a SOAP web service to accept orders and converts them to a flat file format that the legacy fulfillment system accepts. It demonstrates how Mule can act as a proxy to front-end the legacy system and enable it to process orders submitted over HTTP by converting them to the legacy system's file format.
2. 2
Enterprise Edition, CloudHub
This application 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 which must adapt to accept
orders via HTTP request. You can think of this example as an application
that acts as a Web service proxy for a legacy, file-based system.
3. 3
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 via
a SOAP Web service and automatically submitting the orders to the legacy
system for fulfillment. In order to process orders, the company uses Mule to
convert HTTP requests into a file format that the legacy system accepts.
4. 4
Set Up
Create then run,the Legacy Modernization example application in Mule
Studio
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 (see image below).
5. 5
Set Up
In soapUI, select File > Import Project. Browse to the MuleStudio folder
on your local drive to locate the sample soapUI project
file: MuleStudio > workspace > Legacy
Modernization > src >test > resources > LegacyModernizationExampl
e-soapui-project.xml. Click Open.
In the new LegacyModernizationExample project in soapUI, expand the
folders to revealRequest 1. Double-click Request 1 to open the request-
response window.
Click the submit request icon (green "play" button at upper left) to submit
the request to the Mule application (see below, left). soapUI displays the
response from the Mule application in the response pane (see below, right).
7. 7
Set Up
Review the contents of the SOAP response, to examine the details of your
processed request. Note, in particular, the orderReceivedStatus with the
value “true”.
In the Package Explorer in Studio, navigate to src/test/resources/Output,
then hit F5 to refresh the contents of the Output folder. The order you
submitted via soapUI appears as a new ShippingOrder flat file; note the
date and time stamp of the new order (see below). Double-click the flat file
to open it in Studio and examine the contents.
8. 8
How it Works
Using a single flow, this application exposes a SOAP Web service which
accepts new order requests from customers. A Java component processes
the order, returning a response to the caller to advise that the order has
been accepted. Asynchronously (relative to the HTTP request-response
activity), Mule uses a DataMapper 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 the Output folder in the src/test/resources folder
within the application.