Cómo convertir una llamada SoapService en desuso a la nueva UrlFetchApp
He encontrado un ejemplo sobre cómo llamar a un servicio web con scripts de Google Drive aquí:https://developers.google.com/apps-script/articles/soap_geoip_example
function determineCountryFromIP(ipAddress) {
var wsdl = SoapService.wsdl("http://www.webservicex.net/geoipservice.asmx?wsdl");
var geoService = wsdl.getGeoIPService();
var param = Xml.element("GetGeoIP", [
Xml.attribute("xmlns", "http://www.webservicex.net/"),
Xml.element("IPAddress", [
ipAddress
])
]);
var result = geoService.GetGeoIP(param);
return result.Envelope.Body.GetGeoIPResponse.GetGeoIPResult.CountryCode.Text;
}
Sin embargo, esto utiliza el SoapService que está en desuso. la documentación dice que debo usarUrlFetchApp Convertir el xml de entrada es fácil. Pero, ¿alguien puede decirme cómo llamar a un servicio web con UrlFetchApp?