rest api中的DELETE方法引发异常:参数太少,应为3,但得到2

rest api中的DELETE方法引发异常:参数太少,应为3,但得到2,rest,marklogic,Rest,Marklogic,我在ML 6.0-3.2中创建了一个资源服务扩展,如下所示: 使用delete方法创建了一个名为export-customer.xqy的xquery模块(省略了其他方法): 使用以下命令安装: curl--anyauth--user-user-user:pass-X PUT-d@/opt/export-customer.xqy-HContent-Type:application/xquery”http://server1:8020/v1/config/resources/exportCustom

我在ML 6.0-3.2中创建了一个资源服务扩展,如下所示:

使用delete方法创建了一个名为export-customer.xqy的xquery模块(省略了其他方法):

使用以下命令安装:

curl--anyauth--user-user-user:pass-X PUT-d@/opt/export-customer.xqy-HContent-Type:application/xquery”http://server1:8020/v1/config/resources/exportCustomer?title=exportCustomer&method=get&method=put&method=post&method=delete&get:customer=xs:string&delete:customer=xs:string“

使用以下命令调用:

curl--anyauth--user-user:pass-X DELETE”http://server1:8020/v1/resources/exportCustomer?rs:customer=105“

此调用的结果如下所示:

<rapi:error xmlns:rapi="http://marklogic.com/rest-api"><rapi:status-code>500</rapi:status-code><rapi:status>INTERNAL ERROR</rapi:status><rapi:message-code>XDMP-TOOFEWARGS</rapi:message-code><rapi:message>XDMP-TOOFEWARGS: (err:XPST0017) xdmp:function(fn:QName("http://marklogic.com/rest-api/resource/exportCustomer", "delete"))($context, $resource-params) -- Too few args, expected 3 but got 2.  See the MarkLogic server error log for further detail.</rapi:message></rapi:error>
我甚至不知道该采取什么方法来尝试和调试它。它还没有进入我的代码


任何帮助都将不胜感激。

错误消息说函数需要三个参数,但REST API使用两个参数调用它。它还表示要查看ErrorLog.txt以了解更多详细信息


我看到您在文档中的示例中对函数声明进行了建模。只是一个猜测,但也许文件是错的?尝试从函数声明中删除$input参数。如果你想一想,为什么要删除它?

事实证明你的猜测是正确的。删除第三个参数:
$input as document-node()*
的效果非常好。
<rapi:error xmlns:rapi="http://marklogic.com/rest-api"><rapi:status-code>500</rapi:status-code><rapi:status>INTERNAL ERROR</rapi:status><rapi:message-code>XDMP-TOOFEWARGS</rapi:message-code><rapi:message>XDMP-TOOFEWARGS: (err:XPST0017) xdmp:function(fn:QName("http://marklogic.com/rest-api/resource/exportCustomer", "delete"))($context, $resource-params) -- Too few args, expected 3 but got 2.  See the MarkLogic server error log for further detail.</rapi:message></rapi:error>
        if (empty($tx-ids))
->      then rsrcmodupd:exec-delete-impl($headers,$endpoint-params,$responder)
        else