+ Start a Discussion

Endpoint is not valid in using a webservice


I'm developing an application which use an external webservice and when I call him, I get this error message :
System.CalloutException: Endpoint is not valid

I don't understand what is wrong because if I try this URL in the browser, it works.

This is the endpoint : https://maps.googleapis.com/maps/api/geocode/json?address=+94+Rue+de+Provence+75009+Paris+france&components=country:france|postal_code:75009&language=france

I don't understand why but this endpoint works :

I use the Google's API to normalize addresses and it works if I don't use the postal code or the country in the same time.
Postal code + ountry = doesn't work
Postal code = works
Country = works

I created a remote site in Salesforce.com and it is active : https://maps.googleapis.com

If I enter the endpoint (full, postal code with the country) in the Google browser, it works..

Please help mep, I feel crazy.. :
Deepak BalurDeepak Balur
Have you registered the endpoint in the remote site settings page?
Yes, I have registred the endpoint in the remote site settings page.

User-added image

What I don't understand is the calling works but not with all of the address.

What I've forgotten please?