WSO2 ESB Unable to convert complete JSON data to XML

后端 未结 4 1731
梦谈多话
梦谈多话 2020-12-11 04:08

I am constructing a POC. And I created a pass through proxy service for Google Plus. Without using any proxy service I get this is my output :

 {
   \"kind         


        
4条回答
  •  [愿得一人]
    2020-12-11 04:58

    This is one of the limitations of the current axis2 JSON builder/formatter. We are currently working on a new builder/formatter pair for JSON that does not convert JSON <-> XML. Instead it(builder) stores the JSON message as a stream and the script mediator can be used to build a JSON object out of that stream. For example, if we send {"a" : "x", "b" : "y"} as the request, within the ESB, we can manipulate this request as a JSON object with javascript.

    var a = mc.getJSON().a.toString();
    var b = mc.getJSON().b.toString();
    mc.setPayloadXML(
        
            {a}
            {b}
        );
    

    Similarly mc.setJSON() method can be used to set arbitrary JSON objects.

提交回复
热议问题