1

我正在尝试在我在 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);
    });

我究竟做错了什么?谢谢!

4

1 回答 1

1

您收到此错误是因为您没有使用修改后的 suds.js 钛,您可以从厨房水槽示例或 suds github https://github.com/kwhinnery/上的钛移动示例中获得正确的错误。 Suds/tree/master/TitaniumMobileExample/CurrencyConverter/Resources

于 2013-07-08T02:19:58.113 回答