Search code examples
muleanypoint-studiodataweave

Convert xml payload to a string in dataweave 2.0


How to convert xml payload to a string in dataweave 2.0?

Thanks Vempati


Solution

  • The best way would be something like.

    output application/java
    ---
    payload.^raw as String
    

    The .^raw returns the underlying input stream then we transform it into a String and return it as a Java Value so the payload is a java.lang.String