对 api 的直接请求可以正确响应,但 wso2 apim 网关不能正确响应
我正在使用 wso2 apim 4.0.0。我遇到的问题是,当我向 api (http://localhost:7743/api/products) 本身发送直接请求时,它会正确响应(即返回产品列表)。
[
{
"id":1,
"name":"a"
},
{
"id":2,
"name":"b"
}
]
但是将该 api 发布到 apim 后,当我调用该 api (http://localhost:8243/api/products/v1) 时,它会不断返回“未找到”,这是不正确的。
{
"statusCode": "404",
"statusDescription": "Not found"
}
上面的响应来自我的 api 本身,而不是来自网关。 我取消选中发布者中的响应缓存,重新启动服务器。但一切都没有改变。
欢迎任何解决该问题的提示
I am using wso2 apim 4.0.0. The issue that I am stuck with is when I send a direct request to an api (http://localhost:7743/api/products) itself it response back properly (i.e. It returns list of products).
[
{
"id":1,
"name":"a"
},
{
"id":2,
"name":"b"
}
]
But after publishing that api to apim, when I invoke that api (http://localhost:8243/api/products/v1) it keeps giving back not found which is incorrect.
{
"statusCode": "404",
"statusDescription": "Not found"
}
The response above is coming from my api itself not from gateway.
I unchecked response caching in publisher, restarted the server. But nothing has changed.
Any hint to overcome the issue is welcomed
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
网关端口默认为 8243。但您尝试使用端口 9443 调用它。更改端口值并重试。另外,请确保网关中部署了相关的 API。如果没有,即使 API 已发布,它也不会在网关中可用,并且您将无法获得正确的响应。
The gateway port is by default 8243. But you have tried to invoke it using port 9443. Change the port value and try it again. Also, ensure that the relevant API is deployed in the gateway. If not, even if the API is published it will not be available in the gateway and you won't be able to get the correct response.