将值从文本框传递到 http 适配器失败的 mobilefirst 平台

Passing value from textbox to http adapter failed mobilefirst platform

我正在尝试将一些值从文本框传递到 http 适配器,但出现以下错误:

这里是index.html

  Username:<br>
   <input type="text" name="username" id="username"><br>
    Password:<br>
   <input type="text" name="password" id="password"><br>

    <button onclick="mobgetVerify()">Login</button>
    <p> 
    <p id="demo"></p> <br />        
    <br />
    <br />

mains.js

function mobgetVerify() {

   alert("Hi" + $('#username').val() + $('#password').val());
    var invocationData = {
           adapter : 'LoginAdapter',
           procedure : 'getVerify',
           parameters : [ $('#username').val() , $('#password').val() ]
    };

    WL.Client.invokeProcedure(invocationData, {
           onSuccess : getVerifySuccess,
           onFailure : getVerifyFailure,
    });
};

 function getVerifySuccess(res) {


        var httpStatusCode = res.status;
        if (200 == httpStatusCode) {
               var invocationResult = res.invocationResult;
               var isSuccessful = invocationResult.isSuccessful;
               if (true == isSuccessful) {

                   $("#demo").html(JSON.stringify(res.responseJSON.data));   

          if (res.responseJSON.data== "True "){
                         window.location="pages/view.html";
                     }

                     alert("Success: Value= " + res.responseJSON.data);



               } else {
                     alert("Error. isSuccessful=" + isSuccessful);
               }
        } else {
               alert("Error. httpStatusCode=" + httpStatusCode);
        }

};

function getVerifyFailure(result){
    alert("Verification Failure");
};

如果能得到一些帮助,我将不胜感激。谢谢。

所提供的示例应用程序运行良好...我收到了一个警告对话框,其中包含文本:"Success: Value=False"。

我能想到的唯一区别是,在您的每个问题中每次都与...如果 IP 地址有关。在您提供的 LogCat 中,它显示服务器的 IP 地址是“10.0.0.3”,而我的是我的实际 IP 地址(在我的例子中是 9.148.x.y)。

正如之前建议的那样 - 在 wlclient.properties 中使用正确的服务器 IP 地址。

为了检查我的情况,我在终端中输入了以下内容:ifconfig(在 Windows - "ipconfig" 中)。