Domanda

WSO2 API Manager 1.6.0 introduced a new problem, a REST Post to addAPI returns success but the added API record is incomplete, thus unusable. Inspecting the log file, I traced the issue to /publisher/site/themes/default/templates/overview/template.jag#3, a change in the jaggery file template.jag causes a java null pointer exception on line 3 with the following code 'var endpoint_config = parse(api.endpointConfig);'

With API Manager 1.5.0 this same REST API call worked but it took 3 min to complete on a VMWare box running SLES 11 SP2. Adding an API via the web interface also took 3 min. Trying both on Mac OS X and Windows, it took about 3 secs to run. With API Manager 1.6.0 on the same environments, the web interface now runs under 6 secs and the added API is correct. Now adding an API via the REST call results in an incomplete record being created, tested on both VMWare with SLES 11 SP2 and Mac OSX Mavericks.

Anyone experienced this issue?

È stato utile?

Soluzione

It seems documents related to publisher APIs have not been updated yet. With API Manager 1.6.0 there has been a change in the way endpoints are stored. To make the REST API call working can you try with a request similar to following;

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"

When decoding the request you can see that endpoint is now defined as a JSON

endpoint_config={"production_endpoints":{"url":"http://gdata.youtube.com/feeds/api/standardfeeds/most_popular","config":null},"endpoint_type":"http"}
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top