0
我目前正在使用Google Apps腳本來調用簡單的SOAP服務調用。但是,我不斷收到錯誤。有沒有人有我可以使用的例子或可能看到我的代碼有什麼問題?我的代碼如下:使用Google Apps腳本的SOAP服務呼叫產生錯誤
function onOpen()
{
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheets()[0];
var myValue = Browser.inputBox("Enter an IP address to trace:");
var b1Range = sheet.getRange("B1");
b1Range.setValue(myValue);
determineCountryFromIP(myValue);
}
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;
}