2. • This tutorial walks you through how to use Anypoint Studio to build a
simple HTTP request-response application. After creating and running
the example locally, you will be able to apply what you have learned
to create more complex applications.
3. Goals
• Create an application in Anypoint Studio containing a single flow that
• receives an HTTP request
• logs the message payload
• returns a modified payload as an HTTP response
• Run the application on a local runtime embedded in Anypoint Studio.
• Test the application using your browser.
• Stop the application.
• Edit the application and rerun it.
• (Optional) Apply your knowledge to an extra credit challenge.
4. Open Studio
• If you have already launched Studio as part of the installation process, and it is now running, skip the rest of this section and
proceed directly to Creating a New Project.
• Navigate to the directory on your local drive in which you installed Studio.
• Double-click the executable file to launch Studio.
• AnypointStudio.exe in Windows
• AnypointStudio.app in Mac OS
• AnypointStudio in Linux
• When Studio presents the Workspace Launcher dialog, click OK to accept the default workspace. If this is the first time you have
launched Studio, you may see a Welcome screen. Click Create a Project to dismiss the screen and jump straight to the New Mule
Project wizard.
5. Creating a New Project
• Unless the New Project Wizard is already open, click File > New > Mule Project.
• Studio opens the New Mule Project wizard. Fill in the Name field with the value
Basic Tutorial.
• Select the Server Runtime to which you will want to deploy your project.
Anypoint Studio automatically populates the Server Runtime field with a default
server that comes bundled with your download. You can change to a different
runtime if you have others installed – this project works with any runtime. For
more about installing additional runtime versions, see Installing Extensions.
• Click Finish to create the project.
• In the Package Explorer, Basic Tutorial.xml appears inside the src/main/app folder.
6. Modeling a Mule Flow
• In this tutorial, your goal is to build an application that receives an HTTP
request, logs the message payload, and then modifies the payload before
returning it as an HTTP response. You can build this application using three
building blocks in Studio
• With just a few clicks, you have modeled your entire application on the
Studio canvas.
• Once you configure the individual elements within it, which you will do in
the next section, this flow will accomplish the goals that you set out to
achieve with this application. Each building block that you selected and
placed on the canvas will perform part of the functionality of your
application, as shown in the image below.
7. Configuring the Flow Elements
• Nearly all Mule elements provide configuration options, which you
can set in one of two ways:
• via the building block Properties tabs in Studio’s visual editor
• via XML code in Studio’s XML editor
8. Running the Application
• Having built, configured, and saved your new application, you are ready to run it on the
embedded Mule server (included as part of the bundled download of Anypoint Studio).
• You can filter out these results in the Editing the Application section, below.
• Congratulations! You’ve run and tested your application!
• You submitted a request to the inbound endpoint of your application via your Web browser.
• The Mule application received your request and logged the payload (whatever you typed after
http://localhost:8084/) to the console.
• The application then sent the message on to the Set Payload transformer, which transformed the
payload per its instructions, then returned the results to your HTTP endpoint.
9. Stopping the Application
• To stop the application, click the red, square Terminate icon above
the console panel.
10. Editing the Application
• ou may have noticed that your browser inserts an additional payload
of “/favicon.ico” upon each refresh. You can add a filter element into
your flow to exclude these payloads.