0
votes

I hope you can help me with WSO2 API Cloud.

I have a sample app that adds two float numbers in WSO2 app cloud. Below are the details:

Endpoint: http://jab7180-sample-calc.wso2apps.com/client/calculate/add/10/20

Output: 30.0

My problem is I'm having problem calling my API after publishing to WSO2 API Cloud. The response body is no content, response code is 0, and response header is no response from server.

This is how I published my API in WSO2 API Cloud using the endpoint above:

Name: calculator

Context: /compute

version: 1.0.0

visibility: public

URL pattern: client/calculate/add/{x}/{y} where verb is GET.

Production Endpoint: http://jab7180-sample-calc.wso2apps.com

Subscription tiers: Unlimited

2
Do you get the same when you call this through any REST client, or just in store console? - Bee
Hi Bhathiya, I just tested it on the store console. The curl command generated was curl -X GET --header 'Accept: application/json' --header 'Authorization: Bearer ebcd41ac-3466-3262-8c8e-3c73c987dbde' 'gateway.api.cloud.wso2.com:443/t/jab7180/compute/1.0.0/client/…' - Jake
does curl one work for you? - Bee
It seems your APIs are unpublished from the gateway. Can you go to edit mode of the calculator API, and then in "Manage" tab, expand the "Gateway Environments" section and make sure the checkbox is clicked. Then please click "Save & Publish". Can you try this again after this step? - Lakmali Erandi Baminiwatta
Thanks Bhathiya and Lakmali. The issue was already resolved by defining the URI params with non-single character. - Jake

2 Answers

0
votes

We found the issue. There is a problem with defining URI params with single-character parameters. As a workaround, please define your resource with different parameters. Ex: /client/calculate/add/{xx}/{yy}

Also, you have to set the "Produces" attribute for the resource as "application/xml" since the default value is "application/json" and is not supported by your backend.

Please refer the screenshot below and define your API resource, and republish the API.

enter image description here

0
votes

From https://docs.wso2.com/display/APICloud/Subscribe+to+and+Invoke+an+API

If you cannot invoke the API's HTTPS endpoint (causes the SSLPeerUnverified exception), it could be because the security certificate issued by the server is not trusted by your browser. To resolve this issue, access the HTTPS endpoint directly from your browser and accept the security certificate.