javascript - IBM Worklight - 适配器部署失败 : Adapter 'BIIOwnAccountFundTransferAdapter.xml' contains errors

标签 javascript xml ibm-mobilefirst worklight-adapters

当我尝试部署工作灯适配器时,出现此错误。我已经清理了我的代码并检查了我的语法,没有任何错误。

控制台内的错误消息

[2014-07-21 12:04:22]             Starting adapter deployment on Worklight Server 
[2014-07-21 12:04:22]             Starting build of adapter: BIIOwnAccountFundTransferAdapter.xml 
[2014-07-21 12:04:22]             Adapter deployment failed: Adapter 'BIIOwnAccountFundTransferAdapter.xml' contains errors 

我的xml代码

<?xml version="1.0" encoding="UTF-8"?>
<!--
    Licensed Materials - Property of IBM
    5725-I43 (C) Copyright IBM Corp. 2011, 2013. All Rights Reserved.
    US Government Users Restricted Rights - Use, duplication or
    disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
-->
<wl:adapter name="BIIOwnAccountFundTransferAdapter"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:wl="http://www.worklight.com/integration"
    xmlns:http="http://www.worklight.com/integration/http">

    <displayName>BIIOwnAccountFundTransferAdapter</displayName>
    <description>BIIOwnAccountFundTransferAdapter</description>
    <connectivity>
        <connectionPolicy xsi:type="http:HTTPConnectionPolicyType">
            <protocol>http</protocol>
            <domain>xxx.xxx.xx.xx</domain>
            <port>9083</port>
            <!-- Following properties used by adapter's key manager for choosing specific certificate from key store  
            <sslCertificateAlias></sslCertificateAlias> 
            <sslCertificatePassword></sslCertificatePassword>
            -->     
        </connectionPolicy>
        <loadConstraints maxConcurrentConnectionsPerNode="2" />
    </connectivity>

    <procedure name="processTransferDetails"/>
    <procedure name="proceedOwnTransferConfirm"/>
    <procedure name="proceedOwnTransferResult"/>

</wl:adapter>

我的js代码

function processTransferDetails(userId) {
    path = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
    var input = {
        method: 'post',
        returnedContentType: 'json',
        path: path,
        body: {
            contentType: 'application/json; charset=UTF-8',
            content: JSON.stringify({
                "locale": "en",
                "userId": userId,
                "serviceInfoType": "FUNOWN"
            })
        }
    };
    return WL.Server.invokeHttp(input);
}

function proceedOwnTransferConfirm(userAlias, password, toCurrency, toAmount,
    fromCurrency, selectedCurrency, payMode) {
    path = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
    var input = {
        method: 'post',
        returnedContentType: 'json',
        path: path,
        body: {
            contentType: 'application/json; charset=UTF-8',
            content: JSON.stringify({
                "locale": "en",
                "serviceInfoName": "Transfer Own Account",
                "fromAccountNumber": fromAccountNumber,
                "toAccountNumber": toAccountNumber,
                "toCurrency": toCurrency,
                "toAmount": toAmount,
                "fromCurrency": fromCurrency,
                "sessionId": "20140703104656008130",
                "selectedCurrency": selectedCurrency,
                "isTacRequired": false,
                "isStandingInstruction": false,
                "payMode": payMode
            })
        }
    };
    return WL.Server.invokeHttp(input);
}

function proceedOwnTransferResult(userAlias, remoteIPAddress) {
    path = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
    var input = {
        method: 'post',
        returnedContentType: 'json',
        path: path,
        body: {
            contentType: 'application/json; charset=UTF-8',
            content: JSON.stringify({
                "userAlias": userAlias,
                "locale": "en",
                "channel": "2",
                "userAgent": "mobile",
                "remoteIPAddress": remoteIPAddress,
                "sessionId": "",
            })
        }
    };
    return WL.Server.invokeHttp(input);
}

请指教

最佳答案

我的适配器没有任何构建/编译问题(复制粘贴到空项目中)。

我个人经历过 Worklight Studio(以及其他 Eclipse 插件)无缘无故地进入不一致状态。发生这种情况时,我通常会尝试删除 <workspace>/<project>/bin 的内容。目录,然后我尝试再次构建应用程序和适配器。

如果这没有帮助,最后的手段通常是删除构建临时文件:

  1. 关闭工作室
  2. 找到您的temp文件夹( WindowsOS X )
  3. 删除 wlBuildResources文件夹
  4. 重新打开 Studio 并尝试再次构建应用和适配器

关于javascript - IBM Worklight - 适配器部署失败 : Adapter 'BIIOwnAccountFundTransferAdapter.xml' contains errors,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24857615/

相关文章:

javascript - Ember 3.5 属于关系未解决

javascript - 替换模型是近似 JavaScript 如何评估纯代码的好方法吗?

javascript - 在滚动条上交替显示 DIV

ios - IBM Worklight - 是否可以在没有 Mac 和 Xcode 的情况下在 iPhone 设备上部署应用程序?

debugging - 如何在浏览器中调试Dojo?

javascript - IBM Worklight - 无法显示使用 SQL 适配器检索的数据

javascript - 使用 Web 服务结果填充变量

c# - 样式问题 : LINQ or XPath to read in XML nodes

java - 使用字符串变量从 xml 返回 getString?

android - 使用 XML 的带箭头的矩形