【发布时间】:2014-05-22 20:36:12
【问题描述】:
我在 API Manager(版本 1.6.0)中配置了 Open Weather API。步骤:
- 添加 API
- 名称:天气
- 上下文:/天气
- 版本:v1
- 层可用性:全部
- 传输:HTTP 和 HTTPS
-
端点类型:HTTP 端点 生产端点:http://api.openweathermap.org/data/2.5/weather
==> 此时,如果我单击“测试”,则会出现“无效”错误。
我仍然继续保存并发布 API。
在 Store 中订阅 API 并尝试在 REST Client 中运行:
http://localhost:8280/weather/v1- 授权:xxxx
一段时间后出现错误响应:
<am:fault
xmlns:am="http://wso2.org/apimanager">
<am:code>101503</am:code>
<am:type>Status report</am:type>
<am:message>Runtime Error</am:message>
<am:description>Error connecting to the back end</am:description>
</am:fault>
在控制台上看到错误:
[2014-05-22 14:11:39,067] 警告 - ConnectCallback 连接被拒绝 或失败或失败:api.openweathermap.org/162.243.44.32:80 [2014-05-22 14:11:39,093] 信息-LogMediator 状态 = 执行默认的“故障” 序列,ERROR_CODE = 101503,ERROR_MESSAGE = 连接到 后端
我在代理后面运行 AM。我认为在连接到外部 URL 时需要告知 AM 通过代理。
我尝试了以下选项: 启动服务器时使用命令:
wso2server.bat -Dhttp.proxyHost= -Dhttp.proxyPort=8085 启动
这样,我无法登录发布者或商店。单击登录提示时,没有任何反应。
如何在AM中配置代理服务器,使AM使用代理服务器连接外部URL?
【问题讨论】:
标签: wso2