"可以't查找变量:window“;在suds.js中

"Can't find variable: window" in suds.js

本文关键字:js window suds 变量 可以 quot 查找      更新时间:2023-09-26

我正试图在Titanium Studio(2.1.1版)中构建的移动应用程序中测试接收SOAP响应。我正在使用suds库来完成此操作,但当我调用它时,我会收到错误

[WARN] Exception in event callback. {
line = 27;
message = "Can't find variable: window"

我真的不知道我为什么会得到这个,我有suds.js库,这个应用程序不会崩溃,只是不会发送。我用来实现这一点的代码是:

var suds = new SudsClient({ 
  endpoint: 'http://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL',
  targetNamespace: 'http://ws.cdyne.com/' 
    });

    var soapBtn = Ti.UI.createButton({
        title:'SOAP',
        bottom:'100'
    });
    homeHolder.add(soapBtn);
    var callParams = {
    ZIP:'33325'
    };
    soapBtn.addEventListener('click',function(e){
    suds.invoke("GetCityForecastByZIP", callParams, function(xmlDoc) {
        var response = xmlDoc.documentElement.getElementsByTagName('GetCityForecastByZIPResult');
        Ti.API.info(response);
    });

我做错了什么?谢谢

您之所以会出现此错误,是因为您没有使用经过修改的suds.js for titanium,您可以从厨房水槽示例或suds github上的titanium移动示例中获得正确的sudsjshttps://github.com/kwhinnery/Suds/tree/master/TitaniumMobileExample/CurrencyConverter/Resources