Subject: Office 2000 read-only

From: Jeremy Bach <[email-masked]>
Date: Tue, 9 Jan 2001 10:58:22 +1100 (EST)

I am following the RFC-2518 WebDAV HTTP protocol to implement WebDAV for 
my web server. So far I am able to have webfolders connecting to our web 
server via WebDAV on a Windows NT platform. 

However the problem I am having is that Office 2000 keep opening documents 
as read-only therefore not allowing me to save directly. I have made my
web server provide a successful lock to the document I want to open and
still no luck. 

I have sniffed the traffic between Office 2000 and my web server and
compare it with other working WebDAV server. The comparsion shows no major
differences except for cookies being set which I don't think is the
problem. Also I have try to match the response of other WebDAV servers
working successfully with Office 2000 and still don't know what else is
needed for my web server to work.

Does anybody know why Office 2000 is always flagging my documents to 
read-only?

Any help/ideas will be greatly appreciated. Attach is a log of my web
server interaction with Word 2000.

[email-masked]
==========================================
OPTIONS / HTTP/1.1
User-Agent: Microsoft Data Access Internet Publishing Provider Cache Manager
Host: janus:2468
Content-Length: 0
Connection: Keep-Alive
Cookie: MyDocC=3A590ca30ADC-219; 

==========================================
HTTP/1.1 200 
Accept-Ranges: bytes
Allow: GET, HEAD, POST, PUT, DELETE, OPTIONS, TRACE, PROPFIND, PROPPATCH, MKCOL, COPY MOVE, LOCK, UNLOCK
Connection: Keep-Alive
Content-Length: 0
Content-Type: text/html
Date: Mon, 08 Jan 2001 23:02:18 GMT
Dav: 1,2
Keep-Alive: timeout=15, max=98
Ms-Author-Via: DAV
Server: simwebs/3.1.2

==========================================
PROPFIND / HTTP/1.1
Accept-Language: en-us
Content-Type: text/xml
Translate: f
Content-Length: 380
Depth: 1
User-Agent: Microsoft Data Access Internet Publishing Provider DAV
Host: janus:2468
Connection: Keep-Alive
Cookie: MyDocC=3A590ca30ADC-219; 

<?xml version="1.0" ?>
<propfind xmlns="DAV:">
<prop>
<name/>
<parentname/>
<href/>
<ishidden/>
<iscollection/>
<isreadonly/>
<getcontenttype/>
<contentclass/>
<getcontentlanguage/>
<creationdate/>
<lastaccessed/>
<getlastmodified/>
<getcontentlength/>
<resourcetype/>
<isstructureddocument/>
<defaultdocument/>
<displayname/>
<isroot/>
</prop>
</propfind>

==========================================
HTTP/1.1 207 
Accept-Ranges: bytes
Connection: Keep-Alive
Content-Length: 4567
Content-Type: text/xml;  charset="utf-8"
Date: Mon, 08 Jan 2001 23:02:18 GMT
Keep-Alive: timeout=15, max=100
Server: simwebs/3.1.2

<?xml version="1.0" encoding="utf-8"?>
<D:multistatus xmlns:D="DAV:">
    <D:response xmlns:F="DAV:">
        <D:href>/99Extra.doc</D:href>
        <D:propstat>
            <D:prop>
                <D:resourcetype/>
                <D:getcontenttype>application/octet-stream</D:getcontenttype>
                <D:getcontentlength>9</D:getcontentlength>
                <D:getlastmodified>Fri,  Jan  5 15:23:36 2001 GMT</D:getlastmodified>
                <D:creationdate>2001-01-02T18:05:48Z</D:creationdate>
            </D:prop>
            <D:status>HTTP/1.1 200 OK</D:status>
        </D:propstat>
        <D:propstat>
            <D:prop>
                 <F:name/>
                 <F:parentname/>
                 <F:href/>
                 <F:ishidden/>
                 <F:iscollection/>
                 <F:isreadonly/>
                 <F:contentclass/>
                 <F:getcontentlanguage/>
                 <F:lastaccessed/>
                 <F:isstructureddocument/>
                 <F:defaultdocument/>
                 <F:displayname/>
                 <F:isroot/>
             </D:prop>
             <D:status>HTTP/1.1 404 Not Found</D:status>
        </D:propstat>
    </D:response>
    <D:response xmlns:F="DAV:">
    <D:href>/SP2Changes.xls</D:href>
        <D:propstat>
            <D:prop>
                <D:resourcetype/>
                <D:getcontenttype>application/octet-stream</D:getcontenttype>
                <D:getcontentlength>159744</D:getcontentlength>
                <D:getlastmodified>Mon,  Jan  8 14:51:54 2001 GMT</D:getlastmodified>
                <D:creationdate>2001-01-02T18:05:48Z</D:creationdate>
            </D:prop>
            <D:status>HTTP/1.1 200 OK</D:status>
        </D:propstat>
        <D:propstat>
            <D:prop>
                 <F:name/>
                 <F:parentname/>
                 <F:href/>
                 <F:ishidden/>
                 <F:iscollection/>
                 <F:isreadonly/>
                 <F:contentclass/>
                 <F:getcontentlanguage/>
                 <F:lastaccessed/>
                 <F:isstructureddocument/>
                 <F:defaultdocument/>
                 <F:displayname/>
                 <F:isroot/>
             </D:prop>
             <D:status>HTTP/1.1 404 Not Found</D:status>
        </D:propstat>
    </D:response>
    <D:response xmlns:F="DAV:">
        <D:href>/Tech.dat</D:href>
        <D:propstat>
            <D:prop>
                <D:resourcetype/>
                <D:getcontenttype>application/octet-stream</D:getcontenttype>
                <D:getcontentlength>3</D:getcontentlength>
                <D:getlastmodified>Fri,  Jan  5 15:35:25 2001 GMT</D:getlastmodified>
                <D:creationdate>2001-01-02T18:05:48Z</D:creationdate>
            </D:prop>
            <D:status>HTTP/1.1 200 OK</D:status>
        </D:propstat>
        <D:propstat>
            <D:prop>
                 <F:name/>
                 <F:parentname/>
                 <F:href/>
                 <F:ishidden/>
                 <F:iscollection/>
                 <F:isreadonly/>
                 <F:contentclass/>
                 <F:getcontentlanguage/>
                 <F:lastaccessed/>
                 <F:isstructureddocument/>
                 <F:defaultdocument/>
                 <F:displayname/>
                 <F:isroot/>
             </D:prop>
             <D:status>HTTP/1.1 404 Not Found</D:status>
        </D:propstat>
    </D:response>
    <D:response xmlns:F="DAV:">
        <D:href>/</D:href>
        <D:propstat>
            <D:prop>
                <D:resourcetype><D:collection/></D:resourcetype>
                <D:getcontentlength>0</D:getcontentlength>
                <D:getlastmodified>Wed Dec 13 15:12:15 2000</D:getlastmodified>
                <D:creationdate>2001-01-02T18:05:48Z</D:creationdate>
            </D:prop>
            <D:status>HTTP/1.1 200 OK</D:status>
        </D:propstat>
        <D:propstat>
            <D:prop>
                 <F:name/>
                 <F:parentname/>
                 <F:href/>
                 <F:ishidden/>
                 <F:iscollection/>
                 <F:isreadonly/>
                 <F:contentclass/>
                 <F:getcontentlanguage/>
                 <F:lastaccessed/>
                 <F:isstructureddocument/>
                 <F:defaultdocument/>
                 <F:displayname/>
                 <F:isroot/>
             </D:prop>
             <D:status>HTTP/1.1 404 Not Found</D:status>
        </D:propstat>
    </D:response>
</D:multistatus>

==========================================
LOCK /99Extra.doc HTTP/1.1
Accept-Language: en-us
Content-Length: 161
Timeout: Second-120
Translate: f
User-Agent: Microsoft Data Access Internet Publishing Provider DAV
Host: janus:2468
Connection: Keep-Alive
Cookie: MyDocC=3A590ca30ADC-219; 

<?xml version="1.0" ?>
<lockinfo xmlns="DAV:">
<locktype>
<write/>
</locktype>
<lockscope>
<exclusive/>
</lockscope>
<owner>jeremy</owner>
</lockinfo>

==========================================
HTTP/1.1 200 
Accept-Ranges: bytes
Connection: Keep-Alive
Content-Length: 589
Content-Type: text/xml; charset="utf-8"
Date: Mon, 08 Jan 2001 23:02:21 GMT
Keep-Alive: timeout=15 max=98
Lock-Token: <opaquelocktoken:efd410aa-d624-11d4-8aed-c8c5851c1632>
Server: simwebs/3.1.2
Transfer-Encoding: chunked

<?xml version="1.0" encoding="utf-8"?>
    <D:prop xmlns:D="DAV:">
        <D:lockdiscovery>
            <D:activelock>
                <D:locktype><D:write/><D:locktype>
                <D:lockscope><D:exclusive/></D:lockscope>
                <D:depth>infinity</D:depth>
                <D:owner>jeremy</D:owner>
                <D:timeout>Second-60800000</D:timeout>
                <D:locktoken>
                    <D:href>opaquelocktoken:efd410aa-d624-11d4-8aed-c8c5851c1632</D:href>
                </D:locktoken>
            </D:activelock>
       </D:lockdiscovery>
    </D:prop>

==========================================
GET /99Extra.doc HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)
Host: janus:2468
Connection: Keep-Alive
Cookie: MyDocC=3A590ca30ADC-219; 

==========================================
HTTP/1.1 200 
Accept-Ranges: bytes
Content-Disposition: inline; filename=99Extra.doc
Content-Length: 9
Content-Type: application/msword
Date: Mon, 08 Jan 2001 23:02:21 GMT
Last-Modified: Fri, 05 Jan 2001 04:23:36 GMT
Server: simwebs/3.1.2

EXTRA

---

From: "Jim Whitehead" <[email-masked]>
Date: Tue, 9 Jan 2001 17:44:38 -0800

Hi Jeremy,

Well, I took a quick look at your protocol trace, and nothing obvious
immediately jumps out at me.  Your lock timout value seems a little high,
but is less than 2^32-1, which is around 4 billion, if memory serves me
well.  It's possible Office doesn't like the timeout value to be too far off
the 120 seconds it requests (although I doubt it, since I have heard of
other people changing this timeout value without any trouble). You're also
not using a status phrase (the "OK" in "HTTP/1.1 200 OK") in the lock
response, but this also shouldn't make any difference. One grasping straw
idea is perhaps Office defaults to read-only if the <isreadonly/> property
isn't set (you're returning 404 for them).  But then why would Office try to
lock the document in the first place?

Anyone have any ideas on Jeremy's problem?

- Jim

> -----Original Message-----
> From: [email-masked]
> [mailto:[email-masked]]On Behalf Of Jeremy Bach
> Sent: Monday, January 08, 2001 3:58 PM
> To: [email-masked]
> Cc: Jeremy Bach
> Subject: Office 2000 read-only
>
>
>

---

From: "Stewart Hersey" <[email-masked]>
Date: Tue, 9 Jan 2001 22:38:45 -0800

Jeremy, Jim et al,

MS folks correct me if I'm way off base:

Isn't Office 2000 security integrated to a degree with the Internet Options control panel.

Perhaps the issue is not with Office 2000 functionality, but with the server's inability to set cookies on your client.

Make sure to check your Intranet Security settings and check the boxes to accept and save cookies.

Since you don't think that this is a problem, and, it probably isn't, you ought to eliminate the possibility completely by opening
up your client machine security wise.

If you are successful, and the files are writeable and can be saved back to the source directory, you can lock it down little by
little, testing each time.

So much for Stewart's grasping-straw idea.

*S*

----- Original Message -----
From: "Jim Whitehead" <[email-masked]>
To: "Jeremy Bach" <[email-masked]>; <[email-masked]>
Sent: Tuesday, January 09, 2001 5:44 PM
Subject: RE: Office 2000 read-only

Hi Jeremy,

- Jim

---

From: Greg Stein <[email-masked]>
Date: Tue, 9 Jan 2001 23:39:54 -0800

On Tue, Jan 09, 2001 at 05:44:38PM -0800, Jim Whitehead wrote:
> other people changing this timeout value without any trouble).

mod_dav has a feature to create a minimum value for the timeout. We've
generally recommended about 10 minutes for the value (and it works fine).
That is nowhere near the 2^32-1, though.

BIG NOTE: Office waits until almost exactly the time specified in the
timeout before refreshing the lock. If Office loses the lock due to a
timeout, then it will *completely* break. The next PUT will pass an If:
header asserting the lock (which is gone), and the PUT will fail with a 412.
Office doesn't know how to recover (e.g. take out a lock again, verify the
etag, etc). The only solution is to have the server say "you time out in N
minutes" but give the app N+M minutes before the real timeout occurs.
mod_dav gives a two minute "fudge factor" for the client to refresh within
the timeout period.

> You're also

Office locks the document when you open it, then unlocks when you close it.
In between, each "save" does a PUT.

It wouldn't be related to the 404 for isreadonly, cuz mod_dav also 404's
that property.

> Anyone have any ideas on Jeremy's problem?

Nope. I know that mod_dav works, but I've never done a trace. So... I don't
know what the difference would be.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/