Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
WSO2 Developers' Guide

You're reading from   WSO2 Developers' Guide SOA and data services with WSO2 Enterprise Integrator

Arrow left icon
Product type Paperback
Published in Sep 2017
Publisher Packt
ISBN-13 9781787288317
Length 368 pages
Edition 1st Edition
Languages
Concepts
Arrow right icon
Authors (2):
Arrow left icon
 Garrido Garrido
Author Profile Icon Garrido
Garrido
 Prieto Estrada Prieto Estrada
Author Profile Icon Prieto Estrada
Prieto Estrada
Arrow right icon
View More author details
Toc

Table of Contents (20) Chapters Close

Title Page
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface
1. Getting Started with SOA and WSO2 FREE CHAPTER 2. Developing Integration Projects with WSO2EI Tooling 3. Building Web Services 4. Building Data Services 5. Transforming the Content of the Payload 6. Conditional Route 7. Quality of Service 8. Tasks Scheduling 9. WSO2 Enterprise Integration Logging 10. WSO2 Enterprise Integration Testing 11. Integrating with VFS 12. Integrating with JMS - WSO2 EI Message Brokering 13. Introduction to Ballerina

Change the format of the content


We follow this use case when we already have content in the payload, but it might not be in the format that we need; for example, when our service receives a request in a specific format but the backend is waiting for a different format, or the backend sends us a message and we need to modify it to format the response to the client. The best way to do this is with the use of Message type.

Message type

Message type is a synapse property that defines the message format of the current payload. Here's the syntax:

<property name="messageType" value="string" scope="axis2"/>

In our flight example, we will change the response of the EI service to return the same information of the backend, but in the JSON format. So, the only change that we need to make is to configure the messageType property in the out sequence of our service to change the format of the payload to JSON:

<property name="messageType" value="application/json"
                                 ...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime
Visually different images