我有一个ESB网络服务客户端上传文件到阿卢斯科使用以下RestAPI。
http://:8080/alfresco/service/api/upload
我理解,API被调用为多部分/表单数据,带有文件和必填字段。当我执行的时候,我得到了下面的ersponse错误。
{
"status": {
"code": 400,
"name": "Bad Request",
"description": "Request sent by the client was syntactically incorrect."
},
"message": "Required parameters are missing",
"exception": "",
"callstack": [],
"server": "Enterprise v5.2.3 (r852994b1-b12) schema 10,065",
"time": "10-Jul-2020 12:26:47"
}我使用WSO2企业服务总线客户端,企业服务总线代码看起来都很好。我唯一可以调试的地方是通过wirelog。wirelog显示alll (请查看下面的屏幕截图)。错误消息包含冲突信息,如
"description":“客户端发送的请求语法错误。”"message":“缺少必需的参数”,
有没有一个日志,我可以从Alfresco服务器端获得,以确定到底是什么问题,哪种语法是不正确的?缺少什么参数?
网线日志屏幕截图如下
发布于 2020-07-11 23:05:33
您遵循的是哪些文档?快速浏览一下这里,我会说您没有发送您应该发送的所有内容:https://docs.alfresco.com/5.0/references/RESTful-UploadUploadPost.html
这是你看到的被触发的情况,所以我会更仔细地查看你实际发送的内容。可以使用Fiddler或类似的软件来记录您的请求并检查它。
// Ensure mandatory file attributes have been located. Need either destination, or site + container or updateNodeRef
if ((filename === null || content === null) || (destination === null && (siteId === null || containerId === null) && updateNodeRef === null))
{
exitUpload(400, "Required parameters are missing");
return;
}此外,在这里可以找到有问题的web脚本,它是用JS实现的,因此添加额外的(临时)日志记录相对容易。
...alfresco\tomcat\webapps\alfresco\WEB-INF\lib\alfresco-remote-api-5.0.d.jar\alfresco\templates\webscripts\org\alfresco\repository\upload\发布于 2020-07-12 13:36:19
您可以使用api-explorer rest api上传文档。
https://api-explorer.alfresco.com/api-explorer/#!/nodes/createNode
https://stackoverflow.com/questions/62835526
复制相似问题