1

UPDATED QUESTION to clarify more.

I have two servers : wso2greg containing custom artefacts and wso2am (api manager).

The gouvernance register is intended to be used internally (intranet) and some of it's feature are intended to be exposed externally and acceded via it's rest API.

In order to manage wso2greg API accesss, we used an wso2am (api manager) server, where we did define an API that act as a proxy for the wso2greg API.

In our experiments, we found the strange behaviour described below :

  1. Successfully direct calling wso2greg artefact rest api (the exact url is https://localhost:9443/resource/1.0.0/artifact/_system/governance/myartifact/art1 and i'm following the documentation of this REST API from here https://docs.wso2.com/display/Governance520/Resources+with+REST+API ) using postman. The API reacts as described in the documentation.

  2. Error 500, reported on wso2greg server, when calling the same REST API, but via API manager (using publisher application).

So as a summary :

  • Directly calling wso2greg rest API woks fine and a got results back
  • Adding this working API, in wso2am and than calling it gives always error 500.

As extra information:

  • Tested with other wso2greg REST API , such as "rating" or "comments" and I was able to call it successfully either directly or throw Api manager.
  • Tried to get information related to default wso2greg artifacts such as restservice, but i got exactly the same pb when (error 500) interagting with API manager.
  • Working with the last version of both products : wso2greg version 5.2.0 and wso2am version 1.10.0

Please advice, or clarify how could i debug this internal error in wso2greg.

Regards,

Community
  • 1
  • 1
MWY
  • 41
  • 5

2 Answers2

0

I hope your not using G-Reg + APIM feature installed version. I presume your using separate G-reg 5.2.0 and APIM x.x.x. Since your using the second option you can't use G-Reg REST API with APIM, therefore you have to use APIM REST API instead.

Get an API

Description:       Get details of a specific API.
URI:               http://localhost:9763/publisher/site/blocks/listing/ajax/item-list.jag
URI Parameters: action=getAPI&name=xxx&version=xxx&provider=xxx
HTTP Methods:   POST
Example:    
               curl -X POST -b cookies http://localhost:9763/publisher/site/blocks/listing/ajax/item-list.jag -d "action=getAPI&name=PhoneVerification&version=1.0.0&provider=admin"

Please follow this link to see all the api usage.

tk_
  • 16,415
  • 8
  • 80
  • 90
  • Thanks, but we would like to use wso2greg api once exposed via API manager as any other internal API. – MWY Jun 28 '16 at 21:45
  • so your governing all the API's which is exposed using APIM in G-Reg? Is there are a rxt defined for API's in G-Reg? Please share the architecture diagram to provide a solution. – tk_ Jun 29 '16 at 04:37
  • Yes, there is a custom rxt defined. – MWY Jun 29 '16 at 09:09
0

Thanks @thusharaK for providing help.

The solution was to add Message Mediation Policies which forces json header on output.

Now i got my correct response from API manager (in fact, i got a binary response in test console and a json response in postman) .

MWY
  • 41
  • 5
  • Will you share a screen-shot with your answer. Im still not sure what was the solution? – tk_ Jun 29 '16 at 11:07