Skip to Main Content

Calling an external REST API via an ADF REST DataControl

Timo HahnMar 28 2017 — edited Apr 3 2017

Hi,

I'm using JDev 12.2.1.2.0 and created a small sample which uses an external REST service (e.g. api.spotify.com) to get some data from the service. A REST DataControl in then build from this REST service. Running the application on the integrated wls and/or a stand alone WLS 12.2.1.2 returns the right data. When I run the application on the JCS instance  the REST calls are not working. All I get in hte logs is

Exception in invoking HTTP method GET from Rest data control. Cause: javax.ws.rs.ProcessingException: java.net.ConnectException: Tried all: 3 addresses, but could not connect over HTTPS to server: api.spotify.com port: 443

It looks like calling an external REST service is not allowed. The whole REST call looke like

https://api.spotify.com/v1/search?q=sorry&type=track

and work perfectly, meaning that it return data.

Is there any configuration needed on the JCS?

Timo

Update: I tried some other things and got another piece of information. I logged into the server as OPC user and used curl to get to the address and got

pastedImage_0.png

Not even a root the url is reachable. So it look like accessing external urls is blocked somehow. Doing the same from the DBCS works without a problem. Using the same curl command I get the right JSON response.

Comments
Post Details
Added on Mar 28 2017
3 comments
451 views