期望的行为
我想在本地测试一个 apiman API 以查看apiman-quickstarts/echo-service的响应(或者如果这在最新版本的 apiman 中不再适用,那么任何 echo 响应都会很棒)。
我试过的
我使用来自官方 apiman 站点apiman
的以下内容进行安装: Ubuntu 17.10
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
、一个Public API
没有API Security
、一个Endpoint
任意定义为http://localhost:8080/apiman-echo
和一个Client App
。由于 API 被定义为Public
,我的理解是不需要Contract
在Client App
. 该Managed Endpoint
API 在 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 文件夹的内容,但是在我的电脑上quickstarts
的wildfly-10.1.0.Final
文件夹中搜索不会返回任何结果:
├── 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
并使其可用于测试的步骤。
echo
在apiman.gitbooks.io/apiman-user-guide和apiman.gitbooks.io/apiman-production-guide中搜索不会产生任何结果,而apiman.io/latest/developer-guide.html状态:
模拟后端 API 是一个简单的“回声”API,它使用 JSON 有效负载响应所有请求,描述它收到的请求
但我不确定如何解释和利用这些信息。