Hello,
I'm using Oracle 11.g, Apex 4.2 and ORDS 3.0.8 on a Windows 10 Server.
ISBNDB.COM recently changed its API. For years I consumed it as an XML payload. It worked fine. But now it appears that XML support was recently removed and I must consume the data with an output format of JSON. Additionally, it seems the base URL changed from ISBNDB.COM to API.ISBNDB.COM
The code below was copied from the ISBN site https://isbndb.com/apidocs#/ . I replaced the text "YOUR_REST_KEY" with my actual key. The text "9780134093413" is the ISBN number of a book to be looked up. This would typically be a variable that would be passed in. It produces expected results.
-
<?php
-
$url = 'https://api.isbndb.com/book/9780134093413';
-
$restKey = 'YOUR_REST_KEY';
-
$headers = array(
-
"Content-Type: application/json",
-
"X-API-Key: " . $restKey
-
);
-
$rest = curl_init();
-
curl_setopt($rest,CURLOPT_URL,$url);
-
curl_setopt($rest,CURLOPT_HTTPHEADER,$headers);
-
curl_setopt($rest,CURLOPT_RETURNTRANSFER, true);
-
$response = curl_exec($rest);
-
echo $response;
-
print_r($response);
-
curl_close($rest);
-
?>
The above PHP code works well. However, this is presenting a few problems in APEX 4.2.
I'm having a problem testing out a Shared Components / Web Services Reference. Here's a copy of the screens



The X-API-Key field contains my private API key that I received from ISBNDB.COM
The URL field = https://api.isbndb.com/book/9780134093413
When I click the TEST button I get the response:
ORA-29273: HTTP request failed
ORA-06512: at "SYS.UTL_HTTP", line 1130
ORA-12545: Connect failed because target host or object does not exist
How do I setup a Web Service Reference for REST / JSON so that produces results like the ones produced with the sample PHP code?
Thanks for looking at this.