REST API with XML Payload icon

REST API with XML Payload

(0 reviews)

home

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

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

Asset versions for 1.0.x

Asset versions
VersionActions
1.0.0

Tags