Hi Experts
I was trying to write service for geocoding using Google Maps API
googleGeolocation.xshttpdest
host = "maps.googleapis.com";
port = 80;
pathPrefix = "/maps/api/geocode/json";
useProxy = true;
proxyHost = "proxy";
proxyPort = 8080;
authType = none;
useSSL = true;
timeout = 30000;
geolocate.xsjs
var destination_package = "crawler.mapsServices";
var destination_name = "googleGeolocation";
function geocoding(location,countryCode){
try{
var dest = $.net.http.readDestination(destination_package, destination_name);
var client = new $.net.http.Client();
//var req = new $.web.WebRequest($.net.http.GET,"?address=Banashankari+2nd+Stage");
var req = new $.web.WebRequest($.net.http.GET,"?address="+location+","+countryCode+"&sensor=false&key=XXXXXXX");
//$.response.setBody(req);
client.request(req,dest);
var response=client.getResponse();
$.response.contentType = "application/json";
$.response.setBody(response.body.asString());
$.response.status = $.net.http.OK;
}
catch (e) {
$.response.contentType = "text/plain";
$.response.setBody(e.message);
}
}
var location ="Banashankari 2nd Stage";
var countryCode="KAR,IN";
geocoding(location,countryCode);
I get the following message in browser
HttpClient.request: request failed. The following error occured: unable to establish connection to proxy:8080 - internal error code: Proxy handshake failed
I have successfully configured the Trust Manger I have also set the SSL in the XS Admin panel. I'm not able to overcome this issue.