ho trovato un esempio su come chiamare un webservice con gli script di Google Drive qui: https://developers.google.com/apps-script/articles/soap_geoip_exampleCome convertire una chiamata SoapService deprecato alla nuova UrlFetchApp
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;
}
Tuttavia, questo utilizza wich SoapService è deprecato. la documentazione dice che dovrei usare UrlFetchApp Convertire l'input xml è facile. Ma qualcuno può dirmi come chiamare un webservice con UrlFetchApp?
Contrassegna questa domanda con 'google-apps-script' invece di' google-drive -sdk'. –