技术文章 - CS336280

处理大型 JSON 负载时,Vuforia Experience Service 返回 http 406 状态

已修改: 26-Feb-2024   


注意:本文已使用机器翻译软件翻译,以方便非英语客户阅读。但翻译内容可能包含语法错误或不准确之处。请注意, PTC对本文所含信息的翻译准确性及使用后果不承担任何责任。请在 此处 查看本文的英文原始版本以便参考。有关机器翻译的更多详情,请单击 此处
感谢您告诉我们。我们将尽快审阅此译文。

适用于

  • Vuforia Studio 8.5.5 to 9.17.0
  • Vuforia Experience Service 8.5.15 to 9.17.0
  • ThingWorx Platform 8.4 to 9.3
  • For Vuforia Studio developers who are not aware of the presence of Vuforia Experience Service, this is a server side of application where stores Experiences published from Vuforia Studio; once it's published, the end users will be able to view the Augmented Reality Experience using Vuforia View
  • Please contact responsible person or implementation partner to implement the workaround in the resolution
  • Issue is relevant for HoloLens 2, IOS (verified on IOS IPad Pro 3 device) , Realwear device and Android platform.

说明

  • 需要使用相机小部件拍照,然后将照片保存在 Thingworx 的存储库中
  • 要将图片保存到数据库,请使用存储库事物中的SaveImage服务
  • 无法将通过 Vuforia Studio 中的相机小部件捕获的图像保存到 Thingworx Repository
  • 将相机部件图像数据属性与 ThingWorx 中的文件存储库事物SaveImage 服务内容属性绑定后,base64 编码的字符串(文本)无法传输并显示 http 406 响应
  • 即使使用 Base64 编码的字符串,ThingWorx 本身也能在SaveImage 服务上正确执行,JSON 示例如下:
{
    "path":"/test/123.jpg",
    "content":<base64-encoded string>
}
  • Vuforia体验服务日志报告http 406响应错误:
:ffff:<IP 地址> - - [日期] "POST /Thingworx/Things/<事物名称>/Services/<服务名称> HTTP/1.1" 406 - " http://localhost:3000/resource/<体验名称>/dist/index-desktop.html " "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, 如 Gecko) Chrome/84.0.4147.105 Safari/537.36" 20008 ms <ES 服务器>:<ES端口> 90943 [日期] - ms - ms - ms - ms
  • 当使用以下具有正确 JSON 正文的 URL 时,Postman 也会失败并显示 http 406 状态码:
http://<ES 主机>:<ES 端口>/Thingworx/Things/<事物名称>/Services/<服务名称>
  • ​​ThingWorx ApplicationLog.log包含以下消息:
YYYY-MM-DD HH:MM:SS.MS+0900 [L: ERROR] [O: c.t.w.Things] [I: ] [U: Administrator] [S: ] [P: ] [T: http-nio-80-exec-5] Unable To Parse JSON Request
YYYY-MM-DD HH:MM:SS.MS+0900 [L: ERROR] [O: c.t.w.BaseService] [I: ] [U: Administrator] [S: ] [P: ] [T: http-nio-80-exec-5] Invalid request: Unable To Parse JSON Request
YYYY-MM-DD HH:MM:SS.MS+0900 [L: WARN] [O: c.t.c.s.c.j.Jsr356ServerConnection] [I: ] [U: ???] [S: ] [P: ] [T: http-nio-80-exec-5] Connection should be closed but message received anyway. Attempting to force close. Message: V1MessageHeader [messageType=3, requestId=92521, endpointId=0, sessionId=51083549, flags=0]
YYYY-MM-DD HH:MM:SS.MS+0900 [L: WARN] [O: c.t.c.s.c.j.Jsr356ServerConnection] [I: ] [U: ???] [S: ] [P: ] [T: http-nio-80-exec-5] Server WebSocket closed unexpectedly and has already been unregistered from Server Endpoint [ws session id: 6] null
  • 我们能够向 ThingWorx 发送数据或从 ThingWorx 接收数据,但当我们尝试从 Vuforia View 向 ThingWorx 发送图片时失败

这是文章 336280 的 PDF 版本,可能已过期。最新版本 CS336280