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.

REST API with XML Payload

REST API with XML Payload

(0 reviews)

Illustrates how to define a REST API that accepts XML payload as the input. It is complementary to the developer blog article that gives step by step instructions to build this example.

Assumptions

This document describes the details of the example within the context of Anypoint Studio. Where appropriate, the XML configuration accompanies the Studio interface
screenshots. This document assumes that you are familiar with Mule and the Anypoint Studio interface.

Example

In this example we have a XML request that contains customer ID. We need to look up customer details from a database table for incoming customer id and send back the XML response.

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 REST XML payload How To example.

  1. Query a database table. To use this example project as is, create a table "customer" using this SQL example
  2. After you create the table, configure the database connector with the details and the driver for the database you are using. Configure the details in file mule-app.properties
  3. To test the project use this sample input request in the API console. Change the customer ID in the input request as per the sample data in your database table.
  4. If using a different database table make sure to update the select statement in the database connector. Currently it is configured to query "customer" table by fetching the customer ID from the incoming request message.

Next

To learn how to build this example out check out this blog where we give step by step instructions.


Reviews

Download
Log into Anypoint Platform to download this asset

Overview

Type
Example
Organization
MuleSoft
Created by
MO
MuleSoft Organization
Published onJun 22, 2017

Versions

VersionRuntime version
1.0.03.7

Tags

howto