0

WSO2 API Manager 1.6.0 引入了一个新问题,添加 API 的 REST Post 返回成功,但添加的 API 记录不完整,因此无法使用。检查日志文件,我将问题追踪到 /publisher/site/themes/default/templates/overview/template.jag#3,jaggery 文件 template.jag 的更改导致第 3 行出现 java 空指针异常,内容如下代码'var endpoint_config = parse(api.endpointConfig);'

使用 API Manager 1.5.0,同样的 REST API 调用有效,但在运行 SLES 11 SP2 的 VMWare 机器上完成需要 3 分钟。通过 Web 界面添加 API 也需要 3 分钟。在 Mac OS X 和 Windows 上都进行了尝试,运行大约需要 3 秒。在相同环境中使用 API Manager 1.6.0,Web 界面现在运行时间不到 6 秒,并且添加的 API 是正确的。现在,通过 REST 调用添加 API 会导致创建不完整的记录,并在带有 SLES 11 SP2 的 VMWare 和 Mac OSX Mavericks 上进行了测试。

有人遇到过这个问题吗?

4

1 回答 1

1

似乎与发布者 API 相关的文档尚未更新。在 API Manager 1.6.0 中,端点的存储方式发生了变化。要使 REST API 调用正常工作,您可以尝试使用类似于以下的请求;

curl -X POST -b cookies  http://localhost:9763/publisher/site/blocks/item-add/ajax/add.jag -d"action=addAPI&name=YouTube1&context=%2Fyoutube1&version=1.0.0&tier=Gold&responseCache=disabled&visibility=public&endpoint_config=%7B%22production_endpoints%22%3A%7B%22url%22%3A%22http%3A%2F%2Fgdata.youtube.com%2Ffeeds%2Fapi%2Fstandardfeeds%2Fmost_popular%22%2C%22config%22%3Anull%7D%2C%22endpoint_type%22%3A%22http%22%7D&endpointType=nonsecured&subscriptions=current_tenant&resourceTemplate=%2F*&resourceCount=0&resourceMethod-0=POST&resourceMethodAuthType-0=Application&uriTemplate-0=%2F*&resourceMethodThrottlingTier-0=Unlimited&tiersCollection=Gold"

解码请求时,您可以看到端点现在定义为 JSON

endpoint_config={"production_endpoints":{"url":"http://gdata.youtube.com/feeds/api/standardfeeds/most_popular","config":null},"endpoint_type":"http"}
于 2014-01-07T17:26:51.183 回答