Expose a Database through a SOAP Web Service icon

Expose a Database through a SOAP Web Service

(0 reviews)

home

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.

Example

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.

Documentation

Read full documentation in GitHub


Reviews

TypeExample
OrganizationMuleSoft
Published by
MuleSoft Organization
Published onJun 22, 2017
Asset overview

Asset versions for 1.0.x

Asset versions
VersionActions
1.0.0