ESB tRestClient

Highlighted
Six Stars

ESB tRestClient

Hi,

 

I am trying to get a response back from an API using tRestClient, however, get the below error:

 

</head><body id=ERR_ACCESS_DENIED>
<div id="titles">
<h1>ERROR</h1>
<h2>The requested URL could not be retrieved</h2>
</div>
<hr>

<div id="content">
<p>The following error was encountered while trying to retrieve the URL: <a href="http://api2.worldweatheronline.com/premium/v1/weather.ashx?key=agjdnepmndewrn8jrxagde4v&amp;q=51.920...>

<blockquote id="error">
<p><b>Access Denied.</b></p>

Access control configuration.

 

I believe I have the correct settings.

I have tried the URL in a browser and I am able to make a call to the API

 

I have googled the issue and cannot find a solution for this.

I am using Talend 7.1 Enterprise.

 

Please can you help in how I can resolve this.

 

Much Obliged. 

 

Thanks.


Accepted Solutions
Community Manager

Re: ESB tRestClient

"ERROR: The requested URL could not be retrieved" is a common proxy server error. I cannot see anything you are doing wrong with your call. I can only assume that this is caused by your proxy. Are you sure you have configured your proxy access correctly? I notice that there is no username.

View solution in original post


All Replies
Community Manager

Re: ESB tRestClient

Can you copy your dynamic URL into a tJavaRow component and print it out to the terminal? Either use ....

System.out.println({url});

....or output the computed url to a tLogRow. Once you've done that, try the URL in a browser and see what you get. I suspect that there might be an error here.

Six Stars

Re: ESB tRestClient

@rhall_2_0 

 

Thank you for coming back to me.

I have the URL send to a tlog and it would seem that for some reason the variables keep getting added on the url.

For some reason he url does not display correctly as it should.

I have highlighted the variable. The far left size is the global variable however it is being repeated.

 

 

 

Community Manager

Re: ESB tRestClient

Can you copy and paste the code you are using here (not a screenshot) and copy and paste the generated URL here (not a screenshot)?

Six Stars

Re: ESB tRestClient

@rhall_2_0 

Apologies.

 

Please see URl

I think the issue is I do not understand how the API url is set up.

I tried it with a quick google API call but it does not work.

"http://www.google.com/?q=hi"

"http://www.google.com/?q="+((String)globalMap.get("lat"))+""

<div id="content">
<p>The following error was encountered while trying to retrieve the URL: <a href="http://www.google.com/?q=Hi&amp;lat=Hi">http://www.google.com/?q=Hi&amp;lat=Hi</a></p>

<blockquote id="error">
<p><b>Access Denied.</b></p>

Six Stars

Re: ESB tRestClient

I tried it with a quick google API call but it does not work.

"http://www.google.com/?q=hi"

"http://www.google.com/?q="+((String)globalMap.get("lat"))+""

<div id="content">
<p>The following error was encountered while trying to retrieve the URL: <a href="http://www.google.com/?q=Hi&amp;lat=Hi">http://www.google.com/?q=Hi&amp;lat=Hi</a></p>

<blockquote id="error">
<p><b>Access Denied.</b></p>
Community Manager

Re: ESB tRestClient

You have some proxy settings. Since your error message is essentially the same for both URLs fired, I'd look at the proxy settings. I do not get this error when I run your google url. 

Six Stars

Re: ESB tRestClient

@rhall_2_0 

 

This is the API that i make call to, when directly entered to web browser it makes a call

 

http://api2.worldweatheronline.com/premium/v1/weather.ashx?key=agjdnepmndewrn8jrxagde4v&q=%2251.9206...

 

This is the URL i put in the component

"http://api2.worldweatheronline.com/premium/v1/weather.ashx?key=agjdnepmndewrn8jrxagde4v&q="+((String..."

 

In the advance setting i have put the port and proxy it should be using.

 

Log Error:

<title>ERROR: The requested URL could not be retrieved</title>

 

<p>The following error was encountered while trying to retrieve the URL: <a href="http://api2.worldweatheronline.com/premium/v1/weather.ashx?key=agjdnepmndewrn8jrxagde4v&amp;q=51.920...>

<blockquote id="error">
<p><b>Access Denied.</b></p>
</blockquote>

<p>Access control configuration prevents your request from being allowed at this time. Please contact your service provider if you feel this is incorrect.</p>

<p>The following error was encountered while trying to retrieve the URL: <a href="http://api2.worldweatheronline.com/premium/v1/weather.ashx?key=agjdnepmndewrn8jrxagde4v&amp;q=51.920...>

I am new to working with API and from what I can see this url should work.

 

 

Community Manager

Re: ESB tRestClient

"ERROR: The requested URL could not be retrieved" is a common proxy server error. I cannot see anything you are doing wrong with your call. I can only assume that this is caused by your proxy. Are you sure you have configured your proxy access correctly? I notice that there is no username.

View solution in original post

Six Stars

Re: ESB tRestClient

@rhall_2_0 Thank you soo much for this. It was a proxy issue. The Talend was running through a server which needed this url to be added to the Proxy. i just needed to make sure that I was not doing anything wrong due to the lack of my knowledge.

Community Manager

Re: ESB tRestClient

Not a problem. Sometimes it can be tricky to figure out service issues as you do not get to see the other side. Glad you have got it working :-)

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

Talend Studio Improvements for API Services

Take a look at the Talend Studio improvements for API Services

Watch Now

Talend API Designer – Technical Overview

Take a look at this technical overview video of Talend API Designer

Watch Now

Talend Integration with Databricks

Take a look at this video about Talend Integration with Databricks

Watch Now