WSO2 ESB doesn't process Put request from API store

。_饼干妹妹 提交于 2019-12-23 04:25:13

问题


We are using WSO2 ESB 4.7.0 and WSO2 API Manager 1.6.0

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.

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

Response: Status 200 OK

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

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

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

Response: Response Body

Response Code 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.

Thanks Kranthi


回答1:


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

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"/>

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 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}

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

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}

Hostname and portnumber are removed from the URL.

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

Thanks Kranthi



来源:https://stackoverflow.com/questions/26472308/wso2-esb-doesnt-process-put-request-from-api-store

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!