简体   繁体   中英

Binary relay in wso2 api manager

We are using wso2 api manager to manage our REST apis. The default configuration in the api manager comes with for application/json content-type. 一起用于application / json内容类型。 I expect the whole data treated as binary and added to a payload node in the soap body. But when we try to send a request to the api manager, the whole request is converted into xml and wrapped by SOAP envelope. This was confirmed by logging the request inside the in-sequence of the proxy created by the api manager for this api, we could see the whole json request converted into xml.

Why does the API Gateway convert from json to xml when relay is used? Is there any configuration that we have to do to disable this xml processing in api manager?

Note: One of our APIs is a high throughput API. This json to xml conversion and then xml to json conversion will add extra load to our processing.

In which version of APIManager you see above issue? If you enabled the Binaryrelay message builders, you will only see the binary message content, when you use log mediator inside any sequence. Did you set the content type of your request properly, when you do POSTing? Please check the relay module conf is added in your axis2 configuration (axis2.xml)

  <module ref="relay"/>

I have found the solution for this. The binary relay happens in the API Manager only if we disable the relay module conf in axis2.xml.

<!--module ref="relay"/-->

By default it is enabled in version 1.3.0 and disabled in 1.3.1. But to make relay work for application/json content-type we have to disable this in addition to using the message builder/formatter of Binary relay. Not sure if this impacts anything else. This may be a bug in the API Manager.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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