Layer7 API Management

  • 1.  Question on Apply JSON Transformation

    Posted Jan 26, 2015 12:17 PM

    Hi

    I have a question on apply JSON Transformation regarding conversion of Soap to JSON element.

    I have done Apply JSON transformation, but I am seeing full SOAP envelope getting converted to JSON

     

    If I want to do only body element is there any way to do it

     

    help is much appreciated.

     

    thanks and regards,

    venugopal(venu)



  • 2.  Re: Question on Apply JSON Transformation

    Posted Jan 27, 2015 03:03 AM

    For your purpose you have extract the paylod first.

    e.g use XPath with /soapenv:Envelope/soapenv:Body/child::* and you get your soap operation and this operation you can transform to JSON.



  • 3.  Re: Question on Apply JSON Transformation

    Posted Feb 02, 2015 12:50 PM

    Hi vgdarur,

     

    DTZ's methodology is correct, you will need to extract the fragment of XML that you wish to translate to JSON from the original XML payload and then convert that fragment, rather than the entire message.  The policy logic that would allow you to do this would look something like this:

     

    • XPath assertion on SOAP message
      • extract XML for desired element using XPath statement
      • save result to variable
    • JSON transformation on variable from XPath assertion

     

    Let us know if that solves your problem, or if you're looking for something more/different.

     

    -Aaron