Contact Free trial Login

Anypoint Exchange

Home to the complete listing of connectors, templates, examples and APIs.
Discover and use proven assets built by the MuleSoft ecosystem, or add assets to a private
tenant of Anypoint Exchange for collaboration and sharing of internal best practices.

Expose a Database through a SOAP Web Service

Expose a Database through a SOAP Web Service

(0 reviews)

Illustrates how to use Mule to create a SOAP webservice without writing Java code. This example application complements How To Series - Part 1. You can create this SOAP service in front of a MySQL database.

After reading this document, creating, and running the example in Mule, you should be able to leverage what you have learned to create a simple SOAP web service in front of any integration application.


In this example, a user calls the Mule application by submitting a
request via a SOAP client (ex-SOAPUI). The application receives the request with a customerID or loanID. It uses the input request parameter to lookup the loan database table. The database record is returned in SOAP response message to the SOAP client.

Set Up and Run the Example

As with other examples, you can create template applications straight out of the box in Anypoint Studio. You can tweak the configurations of these use
case-based examples to create your own customized applications in Mule.

Follow the procedure below to create, then run the application.

  1. Download and setup the MySQL driver in it's default location. You can check out some of the YouTube videos for assistance with this step.

  2. Start the MySQL server from System Preferences

  3. Open the Example project in Anypoint Studio from Anypoint Exchange.

  4. Open src/main/resources/loan.sql and run it in your mysql instance. This script creates a table name "loan" and loads it with mock data.

  5. Open soap-on-db.xml file located in src/main/app directory. Set url attribute of the db:mysql-config element to:

<db:mysql-config name="MySQL_Configuration" host="localhost" port="3306" user="<username>" password="<password>" database="bank" doc:name="MySQL Configuration"/>

Configure the username and password as per the database being used.

  1. Run the example application in Anypoint Studio or Standalone.

  2. Open SOAP UI. Create a new project and point it to the WSDL URL (http://localhost:8081/bank/loan?wsdl). In the request message populate the loanId or customerId for the lookup and press send.


Read full documentation in GitHub


Log into Anypoint Platform to download this asset


Created by
MuleSoft Organization
Published onJun 22, 2017


VersionRuntime version