gpt4 book ai didi

java - Microsoft Word 忽略从 WebDAV 服务器发送的锁定状态

转载 作者:行者123 更新时间:2023-11-30 03:41:32 25 4
gpt4 key购买 nike

我正在使用自定义WebDAV implementation (基于java servlet)。这似乎在很大程度上运作良好 - 除了 Microsoft Word 不会报告锁定文档已锁定给用户。因此,用户可以编辑文档,直到他们尝试保存文档为止,此时用户会在 Microsoft Word 中看到一条不友好的“上传失败”消息。

Upload Failed upon saving a document that is locked by another user.

我的问题的主要目的是了解我是否可以修改 WebDAV 响应以便执行以下一项或多项操作:

  1. 让 Microsoft Word 向用户显示一条消息,说明文档当前已锁定。
  2. 如果存在锁定,则强制 Microsoft Word 以只读状态打开文档。

我运行了 fiddler 并分析了请求和响应轨迹,与 specifications for WebDAV 进行了比较。 。我有点不确定接下来该去哪里,所以非常欢迎任何 WebDAV 专家的帮助!

<小时/>

请求 1

HEAD http://webdavserver:7161/App/WebDAV/577476_Client%2C_3rd_party_or_internal_account._Rheiner_R%C3%BCckversicherungs_GmBH1.doc HTTP/1.1
User-Agent: Microsoft Office Existence Discovery
Connection: Keep-Alive
Host: webdavserver:7161

响应 1

HTTP/1.1 200 OK
Date: Wed, 05 Nov 2014 11:45:32 GMT
Content-Type: application/msword
Last-Modified: Wed, 05 Nov 2014 11:45:30 GMT
ETag: W/"77312-1415187930429"
X-Powered-By: Servlet/2.5 JSP/2.1
<小时/>

请求 2

LOCK http://webdavserver:7161/App/WebDAV/577476_Client%2C_3rd_party_or_internal_account._Rheiner_R%C3%BCckversicherungs_GmBH1.doc HTTP/1.1
Cache-Control: no-cache
Connection: Keep-Alive
Pragma: no-cache
Content-Type: text/xml; charset="utf-8"
User-Agent: Microsoft Office Core Storage Infrastructure/1.0
Translate: f
Timeout: Second-3600
Connection: Keep-Alive
Content-Length: 199
Host: webdavserver:7161

<?xml version="1.0" encoding="utf-8" ?><D:lockinfo xmlns:D="DAV:"><D:lockscope><D:exclusive/></D:lockscope><D:locktype><D:write/></D:locktype><D:owner><D:href>DOMAIN\user</D:href></D:owner></D:lockinfo>

响应 2

HTTP/1.1 207 Unknown
Date: Wed, 05 Nov 2014 11:45:32 GMT
Content-Length: 307
Content-Type: text/xml; charset=UTF-8
X-Powered-By: Servlet/2.5 JSP/2.1

<?xml version="1.0" encoding="utf-8" ?>
<D:multistatus xmlns:D="DAV:"><D:response><D:href>http://tidevwls03:7161/OpenTwinsApp/WebDAV/577476_Client%2C_3rd_party_or_internal_account._Rheiner_R%C3%BCckversicherungs_GmBH1.doc</D:href>
<D:status>HTTP/1.1 423 Locked</D:status>
</D:response>
</D:multistatus>
<小时/>

请求 3

GET http://webdavserver:7161/App/WebDAV/577476_Client%2C_3rd_party_or_internal_account._Rheiner_R%C3%BCckversicherungs_GmBH1.doc HTTP/1.1
Connection: Keep-Alive
Content-Type: text/xml; charset="utf-8"
User-Agent: Microsoft Office Core Storage Infrastructure/1.0
Depth: 0
Translate: f
Connection: Keep-Alive
Host: webdavserver:7161

响应 3

HTTP/1.1 200 OK
Date: Wed, 05 Nov 2014 11:45:32 GMT
Transfer-Encoding: chunked
Content-Type: application/msword
Last-Modified: Wed, 05 Nov 2014 11:45:30 GMT
ETag: W/"77312-1415187930429"
X-Powered-By: Servlet/2.5 JSP/2.1

[byte stream]
<小时/>

请求 4

PROPFIND http://webdavserver:7161/App/WebDAV/577476_Client%2C_3rd_party_or_internal_account._Rheiner_R%C3%BCckversicherungs_GmBH1.doc HTTP/1.1
Cache-Control: no-cache
Connection: Keep-Alive
Pragma: no-cache
Content-Type: text/xml; charset="utf-8"
User-Agent: Microsoft Office Core Storage Infrastructure/1.0
Depth: 0
Translate: f
Connection: Keep-Alive
Content-Length: 208
Host: webdavserver:7161

<?xml version="1.0" encoding="utf-8" ?><D:propfind xmlns:D="DAV:" xmlns:Office="urn:schemas-microsoft-com:office:office"><D:prop><D:creationdate/><D:getlastmodified/><Office:modifiedby/></D:prop></D:propfind>

响应 4

HTTP/1.1 207 Unknown
Date: Wed, 05 Nov 2014 11:45:33 GMT
Content-Type: text/xml; charset=UTF-8
X-Powered-By: Servlet/2.5 JSP/2.1

<?xml version="1.0" encoding="utf-8" ?>
<D:multistatus xmlns:D="DAV:"><D:response><D:href>http://tidevwls03:7161/OpenTwinsApp/WebDAV/577476_Client%2C_3rd_party_or_internal_account._Rheiner_R%C3%BCckversicherungs_GmBH1.doc</D:href>
<D:propstat><D:prop><D:creationdate>2014-11-05T11:45:30Z</D:creationdate>
<D:getlastmodified>Wed, 05 Nov 2014 11:45:30 GMT</D:getlastmodified>
</D:prop>
<D:status>HTTP/1.1 423 Locked</D:status>
</D:propstat>
<D:propstat><D:prop><modifiedby xmlns="urn:schemas-microsoft-com:office:office"/></D:prop>
<D:status>HTTP/1.1 404 Not Found</D:status>
</D:propstat>
</D:response>
</D:multistatus>
<小时/>

从此时起,Microsoft Word 似乎会轮询服务器,尝试获取文档的锁定。用户仍然不知道文档被锁定。我认为这证明了 Word 知道锁。

请求 5

LOCK http://webdavserver:7161/App/WebDAV/577476_Client%2C_3rd_party_or_internal_account._Rheiner_R%C3%BCckversicherungs_GmBH1.doc HTTP/1.1
Cache-Control: no-cache
Connection: Keep-Alive
Pragma: no-cache
User-Agent: Microsoft Office Core Storage Infrastructure/1.0
If: (<>)
Translate: f
Timeout: Second-3600
Connection: Keep-Alive
Host: webdavserver:7161

响应 5

HTTP/1.1 207 Unknown
Connection: close
Date: Wed, 05 Nov 2014 11:46:07 GMT
Content-Length: 307
Content-Type: text/xml; charset=UTF-8
X-Powered-By: Servlet/2.5 JSP/2.1

<?xml version="1.0" encoding="utf-8" ?>
<D:multistatus xmlns:D="DAV:"><D:response><D:href>http://tidevwls03:7161/OpenTwinsApp/WebDAV/577476_Client%2C_3rd_party_or_internal_account._Rheiner_R%C3%BCckversicherungs_GmBH1.doc</D:href>
<D:status>HTTP/1.1 423 Locked</D:status>
</D:response>
</D:multistatus>

最佳答案

响应 2 有多个问题:

关于java - Microsoft Word 忽略从 WebDAV 服务器发送的锁定状态,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26757591/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com