Illustrates how you can use Mule to expose a SOAP Web service. In particular, it illustrates how a Mule application can accept SOAP requests, then orchestrate several Web services to meets the needs of a particular business process. Further, this example performs all of these actions using only XML – no Java. To demonstrate these capabilities, this example is based on the use case of patient admission into a hospital.
This example demonstrates service orchestration and content-based routing within the context of a simple use case: to facilitate patient pre-admission into a hospital. The hospital has an exposed SOAP web service called AdmissionService. Using this web service, a patient's family doctor can perform these tasks:
- For a new patient, create a new patient record (EHR) and episode on an EHR to initiate a patient's admission into the hospital.
- For an existing patient, locate an existing EHR and create a new episode.
EHR (Electronic Health Record) is the electronic patient record that tracks and updates all patient data, such as name, patient ID, billing address, etc.
An episode is the occurrence of an event related to a specific patient. For example, a patient's pre-admission into a hospital counts as an episode on the EHR.
For example, if a family doctor wishes to schedule a surgical procedure for an existing patient at the hospital, the doctor uses her desktop software to record all the relevant data for the existing patient's upcoming surgery. The software then submits a SOAP request to the hospital's AdmissionService, which processes the request – task 2 above – locating the existing EHR for the patient then scheduling the surgical procedure.
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 Anypoint Studio and tweak the configurations of the use case-based templates to create your own customized applications in Mule.
Create and run the example application in Anypoint Studio.
To simulate a request submission to the Mule application, use the soapUI interface available for free download at SoapUI.org. This tool submits a request as though you were a family doctor in this example's use case. If you haven't already done so, download and launch SoapUI.
In SoapUI, select File > Import Project. Browse to the AnypointStudio folder on your local drive to locate the sample request file: AnypointStudio > workspace > XML-only SOAP Web Service > src > main > resources > Hospital-Admission-Example-soapui-project.xml. Click Open.
In the new Hospital Admission Example project in SoapUI, expand the folders to reveal Request 3. Double-click Request 3 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).
Review the contents of the SOAP response, to examine the details of your processed request. Note the response contains information about the patient's new episode and details about billing.