Reputation: 556
I have a rest api created using WSO2 ESB. I want to change the HTTP status code to 404 when the requested API resource does not match with the given URL. Currently I am getting a 'HTTP/1.1 202 Accepted' response. My esb version is 4.0.3.
Upvotes: 2
Views: 5721
Reputation: 167
You can refer to wso2 documentation
<outSequence>
<property name="HTTP_SC" value="404" scope="axis2" />
<send/>
</outSequence>
Upvotes: 1
Reputation: 9
The thing is when the URL is incorrect the request will not enter your code and will be answered by WSO2 ESB/EI itself. So in your code you don't have influence on the response in that case. Maybe it can be configured in WSO2 itself, can't find any on that yet.
Upvotes: -1
Reputation: 5946
Try with <property name="HTTP_SC" value="404" scope="axis2"/>
Upvotes: 14