Reputation: 9244
Do you need to implement the Microsoft WebDav Extension Properties to properly work with Word.
I'm building out a WebDav server ontop of the pre-existing WebDAV.NET open source project. I noticed that with Word 2010 (didn't try other versions) their sample code doesn't correctly handle saving Microsoft Word documents as it will say "Upload failed" even though the document saves correctly and you are the only user of the file. I'm trying to track down the reason why, and one thing that caught my eye was the Microsoft WebDav Extension Properties. The MS page for this states that "A WebDAV server implementing WebDAV Protocol: Microsoft Extensions SHOULD implement the following extended properties." Since it states should, I would assume you do not have to support it to work with Word.
I became suspicious of the extensions when I noted that my propfind request/response looks like the following:
PROPFIND /test123.docx 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: localhost:62954
<?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>
HTTP/1.1 207 Multi-Status
Server: ASP.NET Development Server/10.0.0.0
Date: Mon, 16 Apr 2012 14:11:55 GMT
X-AspNet-Version: 4.0.30319
MS-Author-Via: DAV
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Content-Length: 576
Connection: Close
<?xml version="1.0" encoding="utf-8"?>
<D:multistatus xmlns:D="DAV:">
<D:response>
<D:href>http://localhost:62954/test123.docx</D:href>
<D:propstat>
<D:prop>
<D:creationdate>2012-04-10T08:00:00Z</D:creationdate>
<D:getlastmodified>2012-04-16T09:09:44Z</D:getlastmodified>
</D:prop>
<D:status>HTTP/1.1 200 OK</D:status>
</D:propstat>
<D:propstat>
<D:status>HTTP/1.1 404 Not Found</D:status>
<D:prop>
<modifiedby xmlns="urn:schemas-microsoft-com:office:office" />
</D:prop>
</D:propstat>
</D:response>
</D:multistatus>
In case anyone is curious, the following is my PUT response.
HTTP/1.1 200 OK
Server: ASP.NET Development Server/10.0.0.0
Date: Mon, 16 Apr 2012 14:18:06 GMT
X-AspNet-Version: 4.0.30319
MS-Author-Via: DAV
Cache-Control: private
Content-Length: 0
Connection: Close
Upvotes: 1
Views: 4136
Reputation: 3780
By the way, I found the bug in Sphorium webdav that was causing this. The bug was in the method DavLockBase_InternalProcessDavRequest() and the incorrect line of code was:
string[] _lockTokens = this.RequestLock.GetLockTokens();
which should be:
string[] _lockTokens = this.ResponseLock.GetLockTokens();
Upvotes: 2
Reputation: 9244
No, you don't need to implement the Microsoft WebDAV Extension Properties. (I figured out the answer to my own question)
The issue with WebDAV.NET is that there is a bug in it that an empty LockToken in the header which confuses Word and makes it not give the LockToken to the PUT request.
Upvotes: 1