我在使 wsdl soap 请求中的多个元素正常工作时遇到问题。当我直接在webservicex网站上直接尝试以下转换时,我得到了当前的货币转换。当我尝试在应用程序脚本中做同样的事情时,它总是返回“0”作为速率。我在这里想念什么?
function getCurrencyConversion2(){
var fromCurr = "USD";
var toCurr = "AUD";
var wsdl = SoapService.wsdl("http://www.webservicex.net/CurrencyConvertor.asmx?WSDL");
Logger.log(wsdl.getServiceNames());
var currencyService = wsdl.getService("CurrencyConvertor");
Logger.log(currencyService.getOperationNames());
//var convertOp = currencyService.getOperation("ConversionRate");
var param = Xml.element("ConversionRate", [
Xml.attribute("xmlns", "http://www.webservicex.net/"),
Xml.element("FromCurrency", [fromCurr]),
Xml.element("ToCurrency", [toCurr])
]);
var result = currencyService.invokeOperation("ConversionRate", [param]);
return;
}