2

I design a new api with api manager. when I invoked it in api console, it prompted the msg as the belowling jpg.

look at the jpg ,plz, Those is the following logs after do curl as the folloing

curl -X GET --header 'Accept: application/json' --header 'Authorization: Bearer 8dfb0253-5906-3ee5-ab28-cd53bc190ddc' 'http://172.17.0.1:8280/V2.0.0/common/test/test'

enter image description here

enter image description here enter image description here

Mike
  • 419
  • 1
  • 6
  • 16
  • why there is on reply?? – Mike Dec 27 '16 at 06:04
  • can you try the same cur and get the result? – Thusitha Thilina Dayaratne Dec 27 '16 at 06:22
  • in the image you can see a curl command that API manager sends. So you can directly call it and check if you get the intended results – Thusitha Thilina Dayaratne Dec 27 '16 at 07:23
  • plz ,look at the above log image. – Mike Dec 27 '16 at 10:01
  • According to ur curl command output the resource doesn't exist. Can you check are you using the correct url? – Thusitha Thilina Dayaratne Dec 27 '16 at 10:07
  • @mike wire log clearly shows that request(GET /Demosite/common/test/test)goes from apimanager to backend and backend return 404 response. So please make sure you call the backend via ESB in the right way. – Jenananthan Dec 27 '16 at 12:49
  • [2016-12-27 04:48:58,523] DEBUG - headers http-outgoing-2 >> GET /DemoSite/common/test/test HTTP/1.1 [2016-12-27 04:48:58,524] DEBUG - headers http-outgoing-2 >> Accept: application/json [2016-12-27 04:48:58,524] DEBUG - headers http-outgoing-2 >> Host: demo.vname.biz:8989 [2016-12-27 04:48:58,524] DEBUG - headers http-outgoing-2 >> Connection: Keep-Alive why the url is more than a "/test" ? my real url is "/DemoSIte/common/test" – Mike Dec 27 '16 at 14:26
  • I use curl and it also does not work. Through api manager , the backend url was changed "/DemoSite/common/test/*" , But , There is no real backend url which is "/DemoSite/common/test/*" – Mike Dec 28 '16 at 02:58
  • Your question is not clear. Is the problem having 2 `test` in url? If yes, post a screenshot of API resources in publisher. – Bee Dec 29 '16 at 16:19

1 Answers1

2

Possible reasons for the issue and solutions

  1. Gatway uses https and self singed certificated. Type the gateway url in browser and accept the certificate then try with api console
  2. CORS issue. Enable CORS as described in doc https://docs.wso2.com/display/AM200/Key+Concepts#KeyConcepts-Cross-originresourcesharing
Jenananthan
  • 1,381
  • 2
  • 10
  • 20
  • were you able to invoke api from any rest client like curl ? can you enable wirelog and post the log to question, using wire log you can check whether request hits the apim gw and response come out gw http://mytecheye.blogspot.com/2013/09/wso2-esb-all-about-wire-logs.html – Jenananthan Dec 27 '16 at 07:22
  • 2016-12-27 03:00:44,792 [-] [Timer-11] WARN SynapseAppDeployerDSComponent Waiting for required OSGi services: org.wso2.carbon.message.processor.service.MessageProcessorDeployerService,org.wso2.carbon.message.store.service.MessageStoreDeployerService,org.wso2.carbon.proxyadmin.service.ProxyDeployerService, this is the log in wso2-apigw-errors.log after I do "curl -X GET --header 'Accept: application/json' --header 'Authorization: Bearer 8dfb0253-5906-3ee5-ab28-cd53bc190ddc' 'http://172.17.0.1:8280/V2.0.0/common/test/test'" – Mike Dec 27 '16 at 08:03