Unable to connect to Google Maps API using web lookup

Hi,

I am trying to use Google maps API to calculate distance and duration between 2 geographical locations. When I use URL in my browser, I get results back from Google API. But when I use the URL with query parameters or with post attributes, I am getting a ‘WLA_UNKNOWN_RESPONSE’ error. Has anyone tried making an HTTP request using ‘Web Lookup’? Any suggestions?

Hi,

I would need a bit more information. Can you post what URL and what Google API you are using?

Thanks,
Goran

https://maps.googleapis.com/maps/api/distancematrix/xml?units=imperial&origins=40.6655101,-73.89188969999998&destinations=40.6905615%2C-73.9976592&key=AIzaSyDyi364gy2C8FlYYJHx0u4sxCBgr4MqjK8

Hi,

I think the problem you are having might be due to incorrectly setting the XPath expression variable. Here is an example:

And here is the output:

I hope that helps!
Goran

Hi Gurpreet,

Please, try uploading once again.
It should work. If possible, please share your plan.
I will delete your previous message. It is not being displayed properly. Hope for your understanding.

GMapsQP.plan (5.9 KB)

Hi,

I think your problem is in the input and not the web service step. I did the following and your plan works for me:

  1. In the Text File Reader step, go to Advanced and set Number of lines in Header/Footer to 0 in both fields.
  2. If Error Handling strategy gives you a warning, set the field to rejected.txt
  3. Run the plan.

Here is the output I got:

Goran

Hi Goran,
I have tried as per your suggestion and I am still not able to make it work. I have tried with and without headers. I have tried with different file encoding and still no success. Can you please share your plan and your input file?

Hi,

Here is the plan and the input file. Please note that no information is taken from the input file, because all the parameters for the web service are hard-coded, but the Web Lookup step needs an input step.

GMapsQP.plan (5.5 KB)
web_in.txt (5 Bytes)

I hope this helps,
Goran

I ran your plan which dumps results in web_out and I am getting the same exception I was getting for my plan, see attached.

Hi Gurpreet,

It can be related to your environment configuration. For example, firewall or something similar.
I was able to run the plan and get the necessary outputs.

That is strange. if it was a firewall issue I should not be able to run it through web browser. I have no issues when I submit the request via URL in a web browser. Error is when I run it in a plan.

Hi Gurpreet,

Please, try using the following URL in the URL Pattern* field:
https://maps.googleapis.com:443/maps/api/distancematrix/xml?units=imperial&origins=40.6655101,-73.89188969999998&destinations=40.6905615%2C-73.9976592&key=AIzaSyDyi364gy2C8FlYYJHx0u4sxCBgr4MqjK8

The other reasons can be:

  • you are using proxy
  • you may have different setting defined in Internet Properties

Another way to check whether your computer has the access to the requested URL is to open Command Prompt and use the following command:
telnet maps.googleapis.com 443