WSO2 ESB 不处理来自 API 商店的 Put 请求 [英] WSO2 ESB doesn't process Put request from API store

查看:29
本文介绍了WSO2 ESB 不处理来自 API 商店的 Put 请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们使用的是 WSO2 ESB 4.7.0 和 WSO2 API Manager 1.6.0

We are using WSO2 ESB 4.7.0 and WSO2 API Manager 1.6.0

我有一个 API 定义了 ESB,它接受一个 PUT 请求并将其处理到后端系统并将响应作为成功发回.

I have an API defined the ESB which takes a PUT request and processes it to a back end system and sends back the response as success.

如果我使用soap 客户端或高级Rest 客户端,API 工作正常.请求网址:http://:/CurriculumAdmin/Terms/2010/Classes/11513/LMSURL?LMSURL=KRanthiPUTARCAPI

The API works fine if I use the soap client or Advanced Rest Client. Request URL: http://:/CurriculumAdmin/Terms/2010/Classes/11513/LMSURL?LMSURL=KRanthiPUTARCAPI

回复:状态 200 正常

Response: Status 200 OK

但是如果我使用 WSO2 API 管理器创建一个 API 并从那里使用 try it 选项,我会收到 202 响应

But if I create a API using the WSO2 API manager and use the try it option from there, I get a 202 response

请求网址:https://:/TestURL/v1.0/Terms/2010/Classes/11513/LMSURL?LMSURL=KranthiTestAPI

Request URL: https://:/TestURL/v1.0/Terms/2010/Classes/11513/LMSURL?LMSURL=KranthiTestAPI

其中 TestURL/v1.0 是我的 API 的上下文根/resource.

Where TestURL/v1.0 is the context root /resource for my API.

回复:响应体

响应代码202

我可以看到响应一直持续到 ESB ,但 ESB 不对请求做任何事情,只是简单地将响应代码 202 发送回..

I could see that the response comes till the ESB , but the ESB doesn't do anything with the request and simply sends a response code of 202 back..

非常感谢任何建议/帮助.

Any suggestions / help are highly appreciated.

谢谢克兰提

推荐答案

出现此问题的原因是 WSO2 API 管理器默认设置的参数.

This issue occurs due to a parameter that is set by default by the WSO2 API Manager.

转到/usr/local/wso2/wso2am-1.6.0/repository/deployment/server/synapse-configs/default/api打开对应API的.xml文件,去掉下面一行.

Go to /usr/local/wso2/wso2am-1.6.0/repository/deployment/server/synapse-configs/default/api Open the .xml file of the corresponding API and remove the following line.

<property name="POST_TO_URI" value="true" scope="axis2"/>

该参数默认由 API 管理器设置.WSO2 将在 1.8.0 版中修复他们的产品 API 管理器,以不将此属性设置为默认值.

This parameter is set by API manager by default. WSO2 will make a fix to their product API manager in release 1.8.0 to NOT set this property as default.

更改前的 ESB 日志:TID: [0] [ESB] [2014-10-27 11:16:18,068] 调试 {org.apache.synapse.transport.http.wire} - >> "PUT http://:/CurriculumAdmin/Terms/2010/Classes/11513/LMSURL?LMSURL=www HTTP/1.1[\r][\n]" {org.apache.synapse.transport.http.wire}

ESB Logs Before the change : TID: [0] [ESB] [2014-10-27 11:16:18,068] DEBUG {org.apache.synapse.transport.http.wire} - >> "PUT http://:/CurriculumAdmin/Terms/2010/Classes/11513/LMSURL?LMSURL=www HTTP/1.1[\r][\n]" {org.apache.synapse.transport.http.wire}

观察发送到 ESB 的请求中出现的主机名和端口号

Observer the hostname and portnumber appearing in the request sent to ESB

更改后的 ESB 日志:TID: [0] [ESB] [2014-10-27 11:24:54,478] 调试 {org.apache.synapse.transport.http.wire} - >> "PUT/CurriculumAdmin/Terms/2010/Classes/11513/LMSURL?LMSURL=www HTTP/1.1[\r][\n]" {org.apache.synapse.transport.http.wire}

ESB Logs After the change : TID: [0] [ESB] [2014-10-27 11:24:54,478] DEBUG {org.apache.synapse.transport.http.wire} - >> "PUT /CurriculumAdmin/Terms/2010/Classes/11513/LMSURL?LMSURL=www HTTP/1.1[\r][\n]" {org.apache.synapse.transport.http.wire}

主机名和端口号从 URL 中删除.

Hostname and portnumber are removed from the URL.

这工作正常,因此问题得到解决.希望它对某人有用..

This works fine and hence the issue is resolved. Hope its useful for someone ..

谢谢克兰提

这篇关于WSO2 ESB 不处理来自 API 商店的 Put 请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆