Nav
You are viewing an older version of this section. Click here to navigate to the latest version.

XML-only SOAP Web Service Example

Enterprise, CloudHub

This application is an example of 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.

Service Orchestration

orchestrateThis term applies to the activity of coordinating calls to several different Web services in order to process a single Web service request. As the name implies, an application, such as this example, can orchestrate the sequence of calls to services.  Like the conductor of an orchestra, a single Mule flow signals when to submit calls to services, ensuring that all the moving pieces work together to produce a single response.

Content-based Routing

content_routingMule has the ability to intelligently route a message through different processing pathways according to its content. Using a Choice Router (or Choice Flow Control in Studio), Mule uses an expression to evaluate a message’s properties, or part of its payload, then routes it to a specific pathway (i.e. series of message processors). Content-based routing, as this activity is called, dynamically applies routing criteria to a message at runtime.

Assumptions

This document assumes that you are familiar with Mule ESB and the Mule Studio interface. To increase your familiarity with Studio, consider completing one or more Mule Studio Tutorials. Further, this example assumes you are familiar with XML coding and that you have a basic understanding of Mule flows and SOAP as a Web service paradigm and the practice of WSDL-first Web service development. 

This document describes the details of the example within the context of Mule Studio, Mule ESB’s graphical user interface (GUI), and includes configuration details for both the visual and XML editors. 

Example Use Case

This example demonstrates service orchestration and content-based routing within the context of a simple use case: in order to facilitate patient pre-admission into a hospital, the hospital has exposed a SOAP Web service called AdmissionService. Using this Web service, a patient’s family doctor can perform two tasks:

  1. For a new patient, she can create a new patient record (EHR) and episode on an EHR to initiate a patient’s admission into the hospital.

  2. For an existing patient, she can 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, she 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

Complete the following procedure to create, then run this example in your own instance of Mule Studio. You can create template applications straight out of the box in Mule 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 via screenshots and code snippets. 

  1. Create, then run the example application in Mule Studio.

  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 as though you were a family doctor in this example’s use case.  If you haven’t already done so, download and launch soapUI (see image below).

    soapUI_launch

  3. In soapUI, select File > Import Project. Browse to the MuleStudio folder on your local drive to locate the sample request file: MuleStudio > workspace > XML-only SOAP Web Service > src > test > resources > Hospital-Admission-Example-soapui-project.xml. Click Open.

  4. 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.

  5. 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).

    request-response

  6. 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.

How it Works 

The application is divided into two parts, each stored on separate flow files (.mflow files) in the Mule project.

The Hospital Admissions SOA file contains the heart of the hospital’s SOAP proxy Web service application. It accepts SOAP requests from family doctors, then processes them to locate or create EHRs or episodes. The main flow, admitPatientService, orchestrates calls to services contained within the mocks.mflow file, then ultimately creates and returns a response to the end user.

The mocks file contains the two supporting Web services, PatientService and EHRService which, respectively, query or create new EHRs, or query and create new episodes. It is within these flows that Mule uses content-based routing to process requests submitted by the Hospital Admissions SOA. In a real world scenario, these Web services would likely be owned and maintained by separate hospital admin groups, but for practical purposes we include both of these services in the same Mule project so as to enable end-to-end functionality when you run the app.

Hospital Admissions SOA

This file contains a flow and subflows which, together, form the hospital’s patient pre-admission SOAP proxy Web service. The sections below offer descriptions of the actions of the flow and each subflow as they process end user requests. Refer to the diagram below to visualize the calls between flows, subflows, and other Web services.

AdmitPatientService Flow

This flow is the heart of the hospital’s  pre-admissions Web service.  Through an HTTP endpoint, it accepts a client request (i.e. request from a family doctor) as a SOAP envelope. The body of the SOAP envelope contains the XML which forms the entirety of the message, or the processing request. The flow then transforms the data format of the message from document object model (DOM) to XML. Then begins the service orchestration: using two Flow Ref message processors, this flow orchestrates calls, via subflows, to other hospital Web services to find or create patient EHRs and episodes.  Finally, when all pre-admission activities are complete, this flow uses an Anypoint DataMapper transformer to map data from the responses from the other hospital Web services to a response to send to the end user, including new information about the cost estimates for the patient’s stay in the hospital.

SubFlows

The following table offers a brief description of the activity in each subflow of the AdmissionService application.

Subflow Description of Activity

upsertPatient

This subflow is triggered by the Upsert Patient Flow Ref element in the AdmitPatientService flow. Using a DataMapper transformer, this subflow maps data from the end user request to a structure that the PatientService Web service accepts. Then it uses a Flow Ref element to invoke another subflow – invokePatientService – to perform the actual submission of a request to another hospital Web service. Finally, it converts the response from DOM to XML before returning the data to the main AdmitPatientService flow.

invokePatientService

This subflow is triggered by the upsertPatient subflow. As a proxy client, the SOAP component and HTTP endpoint call the PatientService Web service (ostensibly a Web service the hospital makes available internally; practically the Web service that exists in the mocks .mflow file). It pushes the response it receives to the invokePatient Service subflow.

createEpisode

This subflow is triggered by the Create Episode Flow Ref element in the AdmitPatientService flow. Using a DataMapper transformer, this subflow maps data from the end user request to a structure that the EHRService Web service accepts. Then it uses a Flow Ref element to invoke another subflow – invokeEHRService – to perform the actual submission of a request to another hospital Web service. Finally, it converts the response from DOM to XML before returning the data to the main AdmitPatientService flow.

invokeEHRService

This subflow is triggered by the createEpisode subflow. As a proxy client, the SOAP component and HTTP endpoint call the EHRService Web service, (ostensibly a Web service the hospital makes available internally; practically the Web service that exists in the mocks .mflow file). It pushes the response it receives to the createEpisode Service subflow.

calls_to_services2

There are several important configurations to take note of in this example application.

  • The XML is in the body. Because the XML is contained in the body of the SOAP envelope, you can simply execute actions against the SOAP body, rather than having to dissect and detach the actual message payload from the SOAP envelope. To do this, the Proxy Service SOAP component in the admitPatientService flow indicates that the message payload is just the body, not the whole SOAP envelope. Refer to the Studio Visual Editor (below, left) and Studio XML Editor (below, right) screenshots of the SOAP component’s configuration.

    Similarly, the XML payload is in the body of the request the Proxy Client SOAP components send to the PatientService and EHRService Web services. Again, this obviates the need to dissect the SOAP request and extract the relevant payload upon receipt.

    proxy_service_body_visual

    
        
                     
                  
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    
    <flow name="admitPatientService" doc:name="admitPatientService"
            doc:description="AdmssionService SOAP-based web-service.">
            <http:inbound-endpoint exchange-pattern="request-response"
                host="localhost" port="${http.port}" doc:name="AdmissionService"
                path="AdmissionService" />
            <cxf:proxy-service doc:name="Proxy service"
                namespace="http://www.mule-health.com/SOA/service/admission/1.0"
                payload="body" port="AdmissionPort" service="AdmissionService"
                wsdlLocation="service/AdmissionService.wsdl" />
        ...
        </flow>
  • The application separates tasks into subflows. Mule leverages the CXF framework to expose, consume and proxy Web services. Because CXF functions best with separate subflows to perform Web services calls, this application separates each Web service call into its own, small subflow. +* The AdmissionService Web services was built http://en.wikipedia.org/wiki/Web_service#Automated_design_methods[WSDL-first]. The Web service’s SOAP component includes four important attributes configured according to the table below.

WSDL

           
        
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
 
 
<wsdl:definitions xmlns:mes="http://www.mule-health.com/SOA/message/1.0" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Admission" xmlns:tns="http://www.mule-health.com/SOA/service/admission/1.0" targetNamespace="http://www.mule-health.com/SOA/service/admission/1.0">
 
    <wsdl:types>
 
        <xsd:schema>
            <xsd:import namespace="http://www.mule-health.com/SOA/message/1.0" schemaLocation="xsd/SOA-Message-1.0.xsd" />
        </xsd:schema>
    </wsdl:types>
    <wsdl:message name="admitSubject">
        <wsdl:part element="mes:admitSubject" name="parameters" />
    </wsdl:message>
    <wsdl:message name="admitSubjectResponse">
        <wsdl:part element="mes:admitSubjectResponse" name="parameters" />
    </wsdl:message>
    <wsdl:portType name="Admission">
        <wsdl:operation name="admitSubject">
            <wsdl:input message="tns:admitSubject" />
            <wsdl:output message="tns:admitSubjectResponse" />
        </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="AdmissionSoap" type="tns:Admission">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
        <wsdl:operation name="admitSubject">
            <soap:operation soapAction="http://http://www.mule-health.com/SOA/service/admission/1.0/admitSubject" />
            <wsdl:input>
                <soap:body use="literal" />
            </wsdl:input>
            <wsdl:output>
                <soap:body use="literal" />
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="AdmissionService">
        <wsdl:port binding="tns:AdmissionSoap" name="AdmissionPort">
            <soap:address location="http://www.mule-health.com" />
        </wsdl:port>
    </wsdl:service>
</wsdl:definitions>
Attribute Value Maps to WSDL File

namespace

http://www.mule-health.com/SOA/service/admission/1.0

maps to the target namespace attribute of the wsdl:definition

payload

body

maps to the wsdl:input `and `wsdl:output, in which it specifies use of the literal body of the SOAP message

port

AdmissionPort

maps to the name attribute of the wsdl:port element

service

AdmissionService

maps to the name attribute of the wsdl:service element

wsdlLocation

service/AdmissionService.wsdl

maps not to something in the wsdl file, but to the filepath of the wsdl file itself in the src/main/resources/ directory of the Mule project

xml-only_soap_web_service 


    
              
           
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;mule xmlns:ldap="http://www.mulesoft.org/schema/mule/ldap" xmlns:jdbc-ee="http://www.mulesoft.org/schema/mule/ee/jdbc"
    xmlns:servlet="http://www.mulesoft.org/schema/mule/servlet" xmlns:ajax="http://www.mulesoft.org/schema/mule/ajax"
    xmlns:mulexml="http://www.mulesoft.org/schema/mule/xml"
    xmlns:data-mapper="http://www.mulesoft.org/schema/mule/ee/data-mapper"
    xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking"
    xmlns:cxf="http://www.mulesoft.org/schema/mule/cxf" xmlns:vm="http://www.mulesoft.org/schema/mule/vm"
    xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
    xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.4.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="
 
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
 
http://www.mulesoft.org/schema/mule/cxf http://www.mulesoft.org/schema/mule/cxf/current/mule-cxf.xsd
 
http://www.mulesoft.org/schema/mule/ee/data-mapper http://www.mulesoft.org/schema/mule/ee/data-mapper/current/mule-data-mapper.xsd
 
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
 
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
 
http://www.mulesoft.org/schema/mule/ldap http://www.mulesoft.org/schema/mule/ldap/3.3/mule-ldap.xsd
 
http://www.mulesoft.org/schema/mule/ee/jdbc http://www.mulesoft.org/schema/mule/ee/jdbc/current/mule-jdbc-ee.xsd
 
http://www.mulesoft.org/schema/mule/servlet http://www.mulesoft.org/schema/mule/servlet/current/mule-servlet.xsd
 
http://www.mulesoft.org/schema/mule/ajax http://www.mulesoft.org/schema/mule/ajax/current/mule-ajax.xsd
 
http://www.mulesoft.org/schema/mule/xml http://www.mulesoft.org/schema/mule/xml/current/mule-xml.xsd
 
http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd
 
http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/current/mule-vm.xsd "&gt;
 
    &lt;spring:beans&gt;
        &lt;spring:bean id="property-placeholder"         class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"&gt;
            &lt;spring:property name="location"
                value="classpath:config.dev.properties" /&gt;
        &lt;/spring:bean&gt;
    &lt;/spring:beans&gt;
 
    &lt;mulexml:namespace-manager
        includeConfigNamespaces="true"&gt;
        &lt;mulexml:namespace prefix="soap" uri="http://schemas.xmlsoap.org/soap/envelope/" /&gt;
        &lt;mulexml:namespace prefix="mes" uri="http://www.mule-health.com/SOA/message/1.0" /&gt;
        &lt;mulexml:namespace prefix="mod" uri="http://www.mule-health.com/SOA/model/1.0" /&gt;
    &lt;/mulexml:namespace-manager&gt;
    &lt;data-mapper:config name="admit_subject_to_upsert_patient"
        transformationGraphPath="admit_subject_to_upsert_patient.grf"
        doc:name="DataMapper" /&gt;
    &lt;data-mapper:config name="upsert_patient_response_to_create_episode"
    transformationGraphPath="upsert_patient_response_to_create_episode.grf"
        doc:name="DataMapper" /&gt;
    &lt;object-to-string-transformer name="Object_to_String"
        doc:name="Object to String" /&gt;
    &lt;data-mapper:config name="create_episode_response_to_admit_subject_response"       transformationGraphPath="create_episode_response_to_admit_subject_response.grf"
        doc:name="DataMapper" /&gt;
 
    &lt;flow name="admitPatientService" doc:name="admitPatientService"
        doc:description="AdmssionService SOAP-based web-service."&gt;
        &lt;http:inbound-endpoint exchange-pattern="request-response"
            host="localhost" port="${http.port}" doc:name="AdmissionService"
            path="AdmissionService" /&gt;
        &lt;cxf:proxy-service doc:name="Proxy service"
            namespace="http://www.mule-health.com/SOA/service/admission/1.0"
            payload="body" port="AdmissionPort" service="AdmissionService"
            wsdlLocation="service/AdmissionService.wsdl" /&gt;
        &lt;mulexml:dom-to-xml-transformer
            returnClass="java.lang.String" /&gt;
        &lt;flow-ref name="upsertPatient" doc:name="Upsert Patient" /&gt;
        &lt;flow-ref name="createEpisode" doc:name="Create Episode" /&gt;
        &lt;data-mapper:transform
            config-ref="create_episode_response_to_admit_subject_response"
            doc:name="&amp;lt;createEpisodeResponse /&amp;gt; to &amp;lt;admitSubjectResponse /&amp;gt;" /&gt;
    &lt;/flow&gt;
     
    &lt;sub-flow name="upsertPatient" doc:name="upsertPatient"&gt;
        &lt;data-mapper:transform config-ref="admit_subject_to_upsert_patient"
            doc:name="&amp;amp;lt;admitSubject /&amp;amp;gt; to &amp;amp;lt;upsertPatient /&amp;amp;gt;" /&gt;
        &lt;flow-ref name="invokePatientService" doc:name="Invoke Patient Service" /&gt;
        &lt;mulexml:dom-to-xml-transformer
            returnClass="java.lang.String" /&gt;
    &lt;/sub-flow&gt;
 
    &lt;sub-flow name="invokePatientService" doc:name="invokePatientService"&gt;
        &lt;cxf:proxy-client payload="body"
            enableMuleSoapHeaders="true" doc:name="Proxy client" /&gt;
        &lt;http:outbound-endpoint exchange-pattern="request-response"
            host="localhost" port="${http.port}" path="PatientService" doc:name="PatientService" password="hello123" user="nialdarbey"/&gt;
    &lt;/sub-flow&gt;
 
    &lt;sub-flow name="createEpisode" doc:name="createEpisode"&gt;
        &lt;data-mapper:transform config-ref="upsert_patient_response_to_create_episode"
            doc:name="&amp;amp;lt;upsertPatientResponse /&amp;amp;gt; to &amp;amp;lt;createEpisode /&amp;amp;gt;" /&gt;
        &lt;flow-ref name="invokeEHRService" doc:name="Invoke EHR Service" /&gt;
        &lt;mulexml:dom-to-xml-transformer
            returnClass="java.lang.String" /&gt;
    &lt;/sub-flow&gt;
 
    &lt;sub-flow name="invokeEHRService" doc:name="invokeEHRService"&gt;
        &lt;cxf:proxy-client payload="body"
            enableMuleSoapHeaders="true" doc:name="Proxy client" /&gt;
        &lt;http:outbound-endpoint exchange-pattern="request-response"
            host="localhost" port="${http.port}" path="EHRService" doc:name="EHRService" /&gt;
    &lt;/sub-flow&gt;
 
&lt;/mule&gt;

Mocks

This file contains two flows which act as two independent SOAP Web services within the hospital’s internal network. Each service uses content-based routing to intelligently process Web service requests.

PatientService

This SOAP Web service accepts HTTP requests, transforms the body of the message from DOM to XML, then uses an xpath expression to extract one particular piece of information from the body – the operation – and set it as a variable. The message then encounters a Choice router (or Choice Flow Control, in Studio) which uses MEL expressions to route the message depending upon its content, specifically, the new variable called operation. If the variable’s value is upsertPatient, the router pushes the message into the upsertPatient DataMapper which prepares a response for the caller with a new patient ID; if the variable’s value is anything other than upsertPatient, the router pushes the message into the getPatient DataMapper which prepares a response for the caller with the existing patient ID.  Essentially, the first route creates a new patient record, the second locates existing. Note that as a mock flow, this service is simplified in order to facilitate functionality of the AdmissionService Web service; in a proper service, the flow would likely include calls to databases or other internal services to locate or create new records. 

The Choice router directs messages according to the first expression that evaluates to true. In a more complex routing structure, a router may have to choose between several routes to perform any number of actions, for example, to delete a patient record or update an existing record. The router always evaluates against the MEL expression attribute of the when child elements in the order in which they appear in the config. See the visual editor (below, left) and XML editor (below, right) incarnations of the same choice router’s configuration. (Default in the visual editor maps to otherwise in the XML editor.)

choice_studio 


    
              
           
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
&lt;flow name="PatientService" doc:name="PatientService"&gt;
        ...
        &lt;choice doc:name="Choice"&gt;
            &lt;when expression="#[flowVars.operation == &amp;apos;upsertPatient&amp;apos;]"&gt;
                &lt;processor-chain doc:name="upsertPatient"&gt;
                    &lt;data-mapper:transform config-ref="upsert_patient_to_upsert_patient_response" doc:name="&amp;amp;lt;upsertPatientRequest /&amp;amp;gt; to &amp;amp;lt;upsertPatientResponse /&amp;amp;gt;"/&gt;
                &lt;/processor-chain&gt;
            &lt;/when&gt;
            &lt;otherwise&gt;
                &lt;processor-chain doc:name="getPatient"&gt;
                    &lt;data-mapper:transform config-ref="get_patient_to_get_patient_response" doc:name="&amp;amp;lt;getPatient /&amp;amp;gt; to &amp;amp;lt;getPatientResponse /&amp;amp;gt;"/&gt;
                &lt;/processor-chain&gt;
            &lt;/otherwise&gt;
        &lt;/choice&gt;
    &lt;/flow&gt;

EHRService

Much the same as the PatientService Web service, the EHRService accepts HTTP requests, converts the data format and uses an xpath expression to set a variable on the message. The Choice router then uses MEL expressions to evaluate the content of the newly set variable, then direct it to its corresponding pathway in the flow. Finally, it returns a response to the caller with information about the new or existing episode. Again, this service is simplified in order to facilitate functionality of the AdmissionService Web service; in a proper service, the flow would likely include calls to databases or other internal services to locate or create new records. 

xml-only_soap_web_service2


    
              
           
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
 
&lt;mule xmlns:mulexml="http://www.mulesoft.org/schema/mule/xml"
    xmlns:data-mapper="http://www.mulesoft.org/schema/mule/ee/data-mapper" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns:cxf="http://www.mulesoft.org/schema/mule/cxf" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
 
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
 
http://www.mulesoft.org/schema/mule/cxf http://www.mulesoft.org/schema/mule/cxf/current/mule-cxf.xsd
 
http://www.mulesoft.org/schema/mule/ee/data-mapper http://www.mulesoft.org/schema/mule/ee/data-mapper/current/mule-data-mapper.xsd
 
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
 
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
 
http://www.mulesoft.org/schema/mule/xml http://www.mulesoft.org/schema/mule/xml/current/mule-xml.xsd
 
http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd "&gt;
 
    &lt;data-mapper:config name="insurance_request_to_insurance_response" transformationGraphPath="insurance_request_to_insurance_response.grf" doc:name="DataMapper"/&gt;
 
    &lt;data-mapper:config name="insurance_request_to_insurance_request_rejected" transformationGraphPath="insurance_request_to_insurance_request_rejected.grf" doc:name="DataMapper"/&gt;
 
    &lt;data-mapper:config name="upsert_patient_to_upsert_patient_response" transformationGraphPath="upsert_patient_to_upsert_patient_response.grf" doc:name="DataMapper"/&gt;
 
    &lt;data-mapper:config name="get_patient_to_get_patient_response" transformationGraphPath="get_patient_to_get_patient_response.grf" doc:name="DataMapper"/&gt;
 
    &lt;data-mapper:config name="create_episode_to_create_episode_response" transformationGraphPath="create_episode_to_create_episode_response.grf" doc:name="DataMapper"/&gt;
 
    &lt;data-mapper:config name="find_episodes_to_find_episodes_response" transformationGraphPath="find_episodes_to_find_episodes_response.grf" doc:name="DataMapper"/&gt;
 
    &lt;data-mapper:config name="create_bill_to_create_bill_response" transformationGraphPath="create_bill_to_create_bill_response.grf" doc:name="DataMapper"/&gt;
 
    &lt;data-mapper:config name="audit_request_to_audit_response" transformationGraphPath="audit_request_to_audit_response.grf" doc:name="DataMapper"/&gt;
 
    &lt;flow name="PatientService" doc:name="PatientService"&gt;
        &lt;http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="${http.port}" doc:name="PatientService" path="PatientService"/&gt;
        &lt;cxf:proxy-service doc:name="Proxy service" namespace="http://www.mule-health.com/SOA/service/patient/1.0" payload="body" port="PatientPort" service="PatientService" wsdlLocation="service/PatientService.wsdl"/&gt;
        &lt;mulexml:dom-to-xml-transformer /&gt;
        &lt;set-variable doc:name="operation" value="#[xpath(&amp;apos;fn:local-name(/*)&amp;apos;)]" variableName="operation"/&gt;
        &lt;choice doc:name="Choice"&gt;
            &lt;when expression="#[flowVars.operation == &amp;apos;upsertPatient&amp;apos;]"&gt;
                &lt;processor-chain doc:name="upsertPatient"&gt;
                    &lt;data-mapper:transform config-ref="upsert_patient_to_upsert_patient_response" doc:name="&amp;amp;lt;upsertPatientRequest /&amp;amp;gt; to &amp;amp;lt;upsertPatientResponse /&amp;amp;gt;"/&gt;
                &lt;/processor-chain&gt;
            &lt;/when&gt;
            &lt;otherwise&gt;
                &lt;processor-chain doc:name="getPatient"&gt;
                    &lt;data-mapper:transform config-ref="get_patient_to_get_patient_response" doc:name="&amp;amp;lt;getPatient /&amp;amp;gt; to &amp;amp;lt;getPatientResponse /&amp;amp;gt;"/&gt;
                &lt;/processor-chain&gt;
            &lt;/otherwise&gt;
        &lt;/choice&gt;
    &lt;/flow&gt;
    &lt;flow name="EHRService" doc:name="EHRService"&gt;
        &lt;http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="${http.port}" doc:name="EHRService" path="EHRService"/&gt;
        &lt;cxf:proxy-service doc:name="Proxy service" namespace="http://www.mule-health.com/SOA/service/ehr/1.0" payload="body" port="EHRPort" service="EHRService"  wsdlLocation="service/EHRService.wsdl"/&gt;
        &lt;mulexml:dom-to-xml-transformer /&gt;
        &lt;set-variable doc:name="operation" value="#[xpath('fn:local-name(/*)')]" variableName="operation"/&gt;
        &lt;choice doc:name="Choice"&gt;
            &lt;when expression="#[flowVars.operation == &amp;apos;createEpisode&amp;apos;]"&gt;
                &lt;processor-chain doc:name="createEpisode"&gt;
                    &lt;data-mapper:transform config-ref="create_episode_to_create_episode_response" doc:name="&amp;amp;lt;createEpisode /&amp;amp;gt; to &amp;amp;lt;createEpisodeResponse /&amp;amp;gt;"/&gt;
                &lt;/processor-chain&gt;
            &lt;/when&gt;
            &lt;otherwise&gt;
                &lt;processor-chain doc:name="findEpisode"&gt;
                    &lt;data-mapper:transform config-ref="find_episodes_to_find_episodes_response" doc:name="&amp;amp;lt;findEpisode /&amp;amp;gt; to &amp;amp;lt;findEpisodeResponse /&amp;amp;gt;"/&gt;
                &lt;/processor-chain&gt;
            &lt;/otherwise&gt;
        &lt;/choice&gt;
    &lt;/flow&gt;
 
&lt;/mule&gt;

Documentation

Studio includes a feature that enables you to easily export all the documentation you have recorded for your project.  Whenever you want to easily share your project with others outside the Studio environment, you can export the project’s documentation to print, email, or share online. Studio’s auto-generated documentation includes:

  • a visual diagram of the flows in your application

  • the XML configuration which corresponds to each flow in your application

  • the text you entered in the Documentation tab of any building block in your flow

See Also