简体   繁体   English

WSO2 API网关将JSON转换为JSON

[英]WSO2 API Gateway convert JSON to JSON

I need to configure JSON to JSON transformations with API Manager 2.0 very efficiently. 我需要使用API​​ Manager 2.0非常高效地配置JSON到JSON的转换。 By default, WSO2 API Manager makes transformations JSON-> XML-> and after processing -> XML->JSON I'd like to know how can I do so directly in JSON to reduce latencies. 默认情况下,WSO2 API管理器进行JSON-> XML->转换,并在处理后-> XML-> JSON转换,我想知道如何直接在JSON中进行转换以减少延迟。 Thank you for your help!! 谢谢您的帮助!!

By default, APIM uses PassThrough transport which does not build your message unless it needs to access your message body. 默认情况下,APIM使用PassThrough传输,除非需要访问您的邮件正文,否则它不会生成您的邮件。 So, your json won't be converted to XML in that case. 因此,在这种情况下,您的json不会转换为XML。

For example, if you have configured custom mediation and have a content-aware mediator like <log level="full"/> , APIM has to build (ie convert to XML) your message body so that it can log the entire message. 例如,如果您已经配置了自定义中介,并且具有诸如<log level="full"/>类的内容感知中介,则APIM必须构建(即转换为XML)您的消息正文,以便它可以记录整个消息。

If you don't try to access the message body like that, json will be sent to backend as it is. 如果您不尝试访问这样的消息正文,则json将按原样发送到后端。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM