Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/102.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ibm mobilefirst 如何使用PUT调用MobileFirst平台适配器?_Ibm Mobilefirst_Mobilefirst Adapters - Fatal编程技术网

Ibm mobilefirst 如何使用PUT调用MobileFirst平台适配器?

Ibm mobilefirst 如何使用PUT调用MobileFirst平台适配器?,ibm-mobilefirst,mobilefirst-adapters,Ibm Mobilefirst,Mobilefirst Adapters,这与所问的问题类似,但该问题并没有准确回答问题所在 Customer.xml <?xml version="1.0" encoding="UTF-8"?> <wl:adapter name="Customer" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wl="http://www.ibm.com/mfp/integration" xmlns:http="http://www

这与所问的问题类似,但该问题并没有准确回答问题所在

Customer.xml

<?xml version="1.0" encoding="UTF-8"?>
<wl:adapter name="Customer"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:wl="http://www.ibm.com/mfp/integration"
    xmlns:http="http://www.ibm.com/mfp/integration/http">

    <displayName>Customer</displayName>
    <description>Customer</description>
    <connectivity>
        <connectionPolicy xsi:type="http:HTTPConnectionPolicyType">
            <protocol>https</protocol>
            <domain>kenatibm.cloudant.com</domain>
            <port>443</port>
        </connectionPolicy>
    </connectivity>

    <procedure name="addCustomer"> </procedure>

</wl:adapter>
问题是,尽管我已将该方法定义为PUT,但在使用File Run as | Call MobileFirst Adapter进行测试时,用户界面仅显示GET方法,PUT没有选项

那么,答案是GET将实际执行PUT操作,还是这是一个bug,还是我缺少一个配置参数


我认为您混淆了如何调用/测试适配器,以及它在调用的后端系统上使用的动词。您正在使用GET测试/调用它,但适配器随后正在使用PUT调用后端系统


这与。

大致相同。简言之,答案是GET实际上会执行PUT


参数在GET请求中传递给适配器,然后适配器构造PUT请求以执行实际过程。在代码中,您可以看到向导如何将“param1”传递给函数,然后将其设置为PUT请求的“内容”。肯定有点困惑。

然后我有两个问题。为什么称之为REST调用类型?如果变量总是一个GET,为什么还要有它呢?我同意标签是令人困惑的。然而,此对话框中的字段描述如何调用适配器,而不是它如何调用后端服务。
function addCustomer(param1) {

    var input = {
        method : 'PUT',
        returnedContentType : 'json',
        path : 'userInputRequired',
        body : {
            contentType: 'application/json',
            content : param1
        }
    };

    return WL.Server.invokeHttp(input);
}