【发布时间】:2017-11-26 09:14:50
【问题描述】:
期望的行为
我想在本地测试一个 apiman API 以查看 apiman-quickstarts/echo-service 的响应(或者如果最新版本的 apiman 不再适用,任何回显响应都会很棒)。
我的尝试
我使用the official apiman site 中的以下内容在Ubuntu 17.10 上安装了apiman:
mkdir ~/apiman-1.3.1.Final
cd ~/apiman-1.3.1.Final
curl http://download.jboss.org/wildfly/10.1.0.Final/wildfly-10.1.0.Final.zip -o wildfly-10.1.0.Final.zip
curl http://downloads.jboss.org/apiman/1.3.1.Final/apiman-distro-wildfly10-1.3.1.Final-overlay.zip -o apiman-distro-wildfly10-1.3.1.Final-overlay.zip
unzip wildfly-10.1.0.Final.zip
unzip -o apiman-distro-wildfly10-1.3.1.Final-overlay.zip -d wildfly-10.1.0.Final
cd wildfly-10.1.0.Final
./bin/standalone.sh -c standalone-apiman.xml
使用 apiman GUI (localhost:8080/apimanui/api-manager),我创建了一个Organisation、一个没有API Security 的Public API、一个任意定义为http://localhost:8080/apiman-echo 的Endpoint 和一个Client App。由于 API 定义为 Public,因此我的理解是 Client App 中不需要定义 Contract。
API 的Managed Endpoint 在 GUI 中提供为:
https://localhost:8443/apiman-gateway/MyTestOrganisation/MyTestAPI/2.0
实际行为
这些是卷曲结果:
# using the 'managed endpoint' provided in the gui - https
curl -k https://localhost:8443/apiman-gateway/MyTestOrganisation/MyTestAPI/2.0
<html><head><title>Error</title></head><body>404 - Not Found</body></html>
# using the 'managed endpoint' provided in the gui - http
curl -k http://localhost:8443/apiman-gateway/MyTestOrganisation/MyTestAPI/2.0
curl: (52) Empty reply from server
#using the endpoint i defined
curl -k http://localhost:8080/apiman-echo
<html><head><title>Error</title></head><body>404 - Not Found</body></html>
速成课程文档 (apiman.io/latest/crash-course.html) 指出以下是 apiman 文件夹的内容,但是在我的电脑上的 wildfly-10.1.0.Final 文件夹中搜索 quickstarts 不会返回任何结果:
├── apiman
│ ├── data
│ │ ├── all-policyDefs.json
│ │ └── apiman-realm.json
│ ├── ddls
│ │ ├── apiman_mysql5.ddl
│ │ └── apiman_postgresql9.ddl
│ ├── quickstarts
│ │ ├── echo-service
│ │ ├── LICENSE
│ │ ├── pom.xml
│ │ └── README.md
│ └── sample-configs
│ ├── apiman-ds_mysql.xml
│ └── apiman-ds_postgresql.xml
我觉得我在某处遗漏了一些与“安装”echo-service 并使其可供测试相关的步骤。
在apiman.gitbooks.io/apiman-user-guide 和apiman.gitbooks.io/apiman-production-guide 中搜索echo 不会产生任何结果,而apiman.io/latest/developer-guide.html 状态:
模拟后端 API 是一个简单的“回声”API,它响应所有 带有描述其接收到的请求的 JSON 有效负载的请求
但我不确定如何解释和利用这些信息。
【问题讨论】:
标签: apiman