Hi, Abhinay.
We can't afford offering support for complex tasks like custom script development within scope of Community Support. Please spend some time researching source code and existing custom scripts to learn how to use this class/method properly. If you'll happen to find out it's a bug which prevents its usage, let us know and we'll do our best to fix it and share a solution with you.
>To check the validity of the geolocation_service_url, I pasted the same URL in my browser and successfully obtained the necessary information.
To test whether this url is accessible from custom script you must try to fetch it **from within Gluu Server's container**, not from a browser running on some other machine. Try to retrieve it with `wget` or `curl` from there, it may be simple name resolution issue.