WSO2 API 1.6.0引入了一个新的问题,REST到addAPI返回成功,但是添加的API记录不完整,因此无法使用。检查日志文件时,我将问题跟踪到/publisher/site/themes/default/templates/overview/template.jag#3,-- jaggery文件template.jag中的更改导致了第3行的java指针异常,代码为'var endpoint_config = parse(api.endpointConfig);‘
使用APIManager1.5.0,这个REST调用同样有效,但在运行SLES11SLES的VMWare盒上只需3分钟就完成了。通过web接口添加API也需要3分钟。在Mac和Windows上都尝试过,运行时间大约为3秒。在相同的环境中使用APIManager1.6.0,web接口现在运行在6秒以下,并且添加的API是正确的。现在,通过REST调用添加一个API将导致创建一个不完整的记录,并在VMWare上使用SLES 11 SP2和Mavericks进行测试。
有人经历过这个问题吗?
发布于 2014-01-07 17:26:51
与publisher API相关的文档似乎还没有更新。使用APIManager1.6.0,端点的存储方式发生了变化。要使REST调用工作,您可以尝试使用类似于以下的请求;
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"}https://stackoverflow.com/questions/20974984
复制相似问题