【问题标题】:Intel XDK - Error when trying to consume Web Service from Explore Services panel英特尔 XDK - 尝试从“探索服务”面板使用 Web 服务时出错
【发布时间】:2015-06-03 03:11:19
【问题描述】:

我正在运行 Ubuntu 15.04,当我尝试从 Intel XDK 调用任何 Web 服务 -> 探索服务面板时,响应类似于:

undefined is not a function
TypeError: undefined is not a function at intel.xdk.services.iodocs_.exports.bindCommon (http://127.0.0.1:58889/http-services/api-explorer/iodocs/api-request-common.js:60:14)
at http://127.0.0.1:58889/http-services/api-explorer/iodocs/tryit?functionName=tryIt1433289861198&apiName=db_core&isDebug=true&code=intel.xdk.services.tryIt1433289861198+%3D+intel.xdk.services.iodocs_.bindCommon.bind%28null%2C+%22intel.xdk.services.tryIt1433289

我一直试图弄清楚发生了什么,但我不知道!

【问题讨论】:

    标签: javascript web-services mobile intel-xdk iodocs


    【解决方案1】:

    此错误可能是由于您没有指定一个函数来构建您通过英特尔 XDK 进行的调用的 URL。

    考虑到英特尔 XDK 在您尝试使用 Web 服务时创建的默认结构,您的 js 文件中应该有如下内容。

    (function (credentials, helpers) {
      var exports = {};
    
      exports.YourMethodName = function(params) {
        var url = 'YourURLWithoutParameters'	
        if (params) url = url + '?' + $.param(params);
        return $.ajax({url: url, type: 'GET'});
      };
    	
      return exports;
    })

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-11-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多