简体   繁体   English

WSO2 API管理器返回二进制响应

[英]WSO2 API manager returns binary response

I am very new to WSO2 API manager and trying out my very first simple restful api. 我是WSO2 API管理器的新手,并尝试了我的第一个简单的Restful API。 which returns json response and has no security since it is an internal api. 由于它是内部api,因此它返回json响应并且不具有安全性。

I installed WSO2 API manager locally and trying to call the rest api on my dev server which uses http and no security as I mentioned earlier. 我在本地安装了WSO2 API管理器,并尝试在我的使用http且没有安全性的开发服务器上调用rest api,正如我之前提到的。

Here is how my get url looks like: 这是我的获取网址的样子: 在此处输入图片说明

and here is my url looks like for production and sandbox environment: 这是我在生产和沙箱环境中使用的网址: 在此处输入图片说明

I don't have any message mediation enabled. 我没有启用任何消息中介。

I went to the API store and created a trial application (so that I can get the access token. Eventhough, my dev environment api has no security, I was reading that for throttling and other purpose, I need to pass bearer token to the WSO2 api OR it will reject the request.) 我去了API商店并创建了一个试用应用程序(这样我就可以获取访问令牌。尽管如此,我的开发环境api没有安全性,但我读到出于节流和其他目的,我需要将承载令牌传递给WSO2 api,否则它将拒绝该请求。)

When I am trying to consume the api, I get the following binary message. 当我尝试使用api时,收到以下二进制消息。 在此处输入图片说明

Is there any way I can see the proxy log on WSO2 server so that I can see the request and its header sent to my dev server? 有什么办法可以在WSO2服务器上看到代理日志,以便可以看到请求及其发送到我的开发服务器的标头? How can I fix this binary response to get the proper json response? 如何修复此二进制响应以获得正确的json响应?

I searched all over and can't find solution to it. 我到处搜索,找不到解决方案。

You can use below steps on WSO2 ESB or APIM to enable Wire Logs. 您可以在WSO2 ESB或APIM上使用以下步骤来启用“连线日志”。

  1. Uncomment below line in /repository/conf/log4j.properties 在/repository/conf/log4j.properties中的行下方取消注释

log4j.logger.org.apache.synapse.transport.http.wire=DEBUG log4j.logger.org.apache.synapse.transport.http.wire = DEBUG

  1. Restart Server. 重新启动服务器。

Source - http://lakshanigamage.blogspot.com/2015/03/how-to-enable-wire-logs-in-wso2-esbapim.html 来源-http://lakshanigamage.blogspot.com/2015/03/how-to-enable-wire-logs-in-wso2-esbapim.html

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

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