Tag: ibm mobilefirst

使用NodeJS使用OAuthunit testingMobileFirst Platform Java适配器

我正在编写一个NodeJS应用程序来testing我写的IBM MobileFirst Platform适配器。 我想遵循的方法做到这一点,如下所示: 从http:// localhost:10080 / AppName / authorization / v1 / testtoken获取testing令牌 使用此不记名令牌对我受保护的适配器进行authentication请求。 方法的问题是,当我尝试向testtoken端点发出请求时,出现HTTP 405状态错误。 但是,PostMan也一样。 有没有办法使这个工作在NodeJS应用程序? 我正在使用请求发送请求到MobileFirst服务器。 我正在使用SailsJs编写我的NodeJS应用程序。

如何使用MobileFirst Foundation 8中的REST API从Node.js发送推送通知?

谁知道我在Node.js服务器上实现这个错误是什么? 该参数是有效的,它在我的本地Mac上与海报。 Node.js和MFP 8 Beta在Mac上本地运行。 这里是server.js文件的代码,步骤是: 准备标题 MFP设置 创build发布选项 为MFP推送创buildJSON对象 使用http进行POST调用 编写json推送数据 app.post('/award', function(req, res){ var notificationMessage = req.body.message; // prepare the header // MFP Settings var theAuthorization = "Bearer eyJhbGciOiJSUzI1NiIsImp…….Wg"; var appname = 'com.ionicframework.checkapp'; var http = require('http'); var theHost = 'localhost'; // here only the domain name var thePort = 9080; var thePath […]

IBM Mobile First – mfpdev-cli安装失败

安装npm mfpdev-cli(IBM Mobile First CLI)时遇到问题。 我正在使用节点v 6.11.2 npm v 5.4.1 我无法安装mfpdev-cli。 我收到以下错误: 错误信息: npm ERR! path /Users/divya/Desktop/MFP/mdo-windows-support/package.json npm ERR! code ENOPACKAGEJSON npm ERR! errno -2 npm ERR! syscall open npm ERR! package.json ENOENT: no such file or directory, open '/Users/divya/Desktop/MFP/mdo-windows-support/package.json' npm ERR! package.json npm can't find a package.json file in your current directory. npm ERR! […]

如何对Bluemix中的节点应用程序执行cors请求

我在bluemix上制作了一个nodeapp,并且绑定到了业务规则服务上,而且我还在mobilefirst上创build了另一个应用程序,我创build了我的应用程序UI。 我想从mobilefirst应用程序发送数据和接收数据,我被告知使用cors请求,但我不知道如何做到这一点。 这里是我的app.js文件: var app = require("express")(), restler = require("restler"), bodyParser = require("body-parser"); app.use(bodyParser.json()); app.use(function(request, response, next) { response.header("Access-Control-Allow-Origin", "*"); response.header("Access-Control-Allow-Headers", "Origin, X-Requested-With,Content-Type, Accept"); next(); }); app.post("/", function(request, response) { var options = { username: "resAdmin", password: "replace" }; var url = "https://brsv2-6855bc66.ng.bluemix.net/DecisionService/rest" + "/vacationsRuleApp/1.0/vacationsRuleProject/json"; restler.postJson(url, request.body, options).on('complete', function(data) { response.send(data); }); }); app.listen(process.env.VCAP_APP_PORT || […]

Bluemix中的Android上的MobileFirst令牌错误

我正在尝试Android上的Bluelist演示 ,我收到下面的错误… 看起来移动服务正在投掷401 。 11-03 19:42:52.469 31488-31527/com.ibm.bluelist E/com.ibm.mobile.services.core.http.IBMMutableHttpRequest﹕ Request to 'https://winmobile.mybluemix.net/data/helo' failed. IBMBLUEMIX-0300E: Request by com.ibm.mobile.services.data.IBMData was rejected by MAS. Status=401, Response={"error":"You are not authorized.","status":"failure"} . 11-03 19:42:52.479 31488-31508/com.ibm.bluelist E/getToken(34252)﹕ Server rejected request for with status code 401 com.ibm.mobile.services.data.internal.HttpFailure: Http Response Code: 401 at com.ibm.mobile.services.data.internal.Connection.getToken(Connection.java:199) at com.ibm.mobile.services.data.internal.Connection.access$400(Connection.java:43) at com.ibm.mobile.services.data.internal.Connection$Receiver.run(Connection.java:412) 11-03 19:42:52.479 31488-31508/com.ibm.bluelist E/Connection:Receiver(34252)﹕ Http Response […]