Ibm mobilefirst 使用Worklight适配器调用REST服务时出现问题
我试图通过HTTP从worklight适配器调用rest服务,但出现以下错误:Ibm mobilefirst 使用Worklight适配器调用REST服务时出现问题,ibm-mobilefirst,worklight-adapters,Ibm Mobilefirst,Worklight Adapters,我试图通过HTTP从worklight适配器调用rest服务,但出现以下错误: [ERROR ] FWLSE0035E: Invocation of procedure 'HttpRequest' failed. [project *****] can't parse argument number "arr": [ { "method": "get" 如果我在浏览器中打开调用的URL,它会毫无问题地返回一个json文件 如何修复它?确保正确实现适配器
[ERROR ] FWLSE0035E: Invocation of procedure 'HttpRequest' failed. [project *****]
can't parse argument number
"arr": [
{
"method": "get"
如果我在浏览器中打开调用的URL,它会毫无问题地返回一个json文件
如何修复它?确保正确实现适配器。这是我的项目样本 我的适配器叫Orders Orders.xml
<?xml version="1.0" encoding="UTF-8"?>
<wl:adapter name="Orders"
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>Orders</displayName>
<description>Orders</description>
<connectivity>
<connectionPolicy xsi:type="http:HTTPConnectionPolicyType">
<protocol>https</protocol>
<domain>izify.com</domain>
<port>443</port>
</connectionPolicy>
<loadConstraints maxConcurrentConnectionsPerNode="2" />
</connectivity>
<procedure name="getOrders"> </procedure>
</wl:adapter>
如果您仍然不明白这是关于什么的,您可以在这里阅读有关HTTP适配器的文档
首先,我将添加一些实际的实现代码,重新创建您的问题。添加适配器XML和JS。
function getOrders() {
var input = {
method : 'get',
returnedContentType : 'json',
path : "get_all_orders.php",
parameters:{merchantId:"xxxxxxxxxxxxxxxxx"}
};
return WL.Server.invokeHttp(input);
}