How to write a liquid template for SOAP XML to Custom JSON conversion.

Barath 21 Reputation points
2022-11-14T19:22:16.64+00:00

Hi,

My Goal: convert the SOAP XML response into a JSON response.

SOAP XML:
260235-image.png

JSON Response I want to get it to:
260242-image.png

My Liquid Template For This (XML to JSON):
260236-image.png

Problem
Currently I am not getting output for the ProductId—I just get a "" return back. I can't figure out why this is happening. Not sure if this is a syntax issue in anyway. Using liquid templates, for XML to JSON conversion, how should the ".liquid" file be written in order to achieve the expected JSON response?

Please note, this ".liquid" file is added through "Maps" in an integration account connected to a logic app. The logic app is using the XML to JSON conversion action.

Thank you a lot for the help. Looking forward.

Reference/Credits (for XML):
https://www.mikaelsand.se/2019/06/accessing-soap-envelope-and-body-properties-in-liquid-templates/

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,551 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Barath 21 Reputation points
    2022-11-15T20:27:28.047+00:00

    Solution

    I have resolved this issue. For people referring to this in the future, here is the solution: simply ignore the prefix. That is, the templating will be:

    {<!-- -->{ content.Envelope.Body.PriceList_Response.PriceList.prices.price.productId }}

    This will work.

    Summary
    Suppose you have soapenv:Envelope, just do Envelope by itself. Ignore prefix.

    P.S. I recommend the MS team to leave this question publicly available as there are very limited resources regarding liquid templates.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.