Subject: Status Code/Entity body encoded in XML

From: "Stanley Guan" <[email-masked]>
Date: Tue, 4 Nov 2003 09:32:31 -0800

Hi,

What's the rule of thumb to find out there is an XML payload
in the entity body?  In the following examples, 
    1. Status code alone doesn't provide the clue
        However, the spec. says that:
           "Based on returned status code, the client can 
            always take a resonable course of action."
    2. Content-Type seems to be the clue.

What's the guideline for the server to return an XML payload
in the entity body?  Say, for the PROPFIND, can it returns
200 (instead of 207) as status code and returns the property
value like:
   <?xml version="1.0" encoding="utf-8" ?>
   <D:prop xmlns:D="DAV:">
   ...
   </D:prop>

Will appreciate your clarification!

-Stanley
===============================================
PROPFIND /container/ HTTP/1.1 
Host: www.foo.bar 
Content-Length: xxxx 
Content-Type: text/xml; charset="utf-8" 

   <?xml version="1.0" encoding="utf-8" ?>
   <D:propfind xmlns:D='DAV:'>
     <D:prop><D:lockdiscovery/></D:prop>
   </D:propfind>

>>Response 

HTTP/1.1 207 Multi-Status 
Content-Type: text/xml; charset="utf-8" 
Content-Length: xxxx 

   <?xml version="1.0" encoding="utf-8" ?>
   ...
==============================================
>>Request LOCK /workspace/webdav/proposal.doc HTTP/1.1 Host: webdav.sb.aol.com Timeout: Infinite, Second-4100000000 Content-Type: text/xml; charset="utf-8" Content-Length: xxxx Authorization: Digest username="ejw", realm="[email-masked]", nonce="...", uri="/workspace/webdav/proposal.doc", response="...", opaque="..."    <?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>http://www.ics.uci.edu/~ejw/contact.html>
     </D:owner>
   </D:lockinfo>
>>Response HTTP/1.1 200 OK Content-Type: text/xml; charset="utf-8" Content-Length: xxxx    <?xml version="1.0" encoding="utf-8" ?>
    ...

---

From: Julian Reschke <[email-masked]>
Date: Tue, 04 Nov 2003 19:44:26 +0100

> Will appreciate your clarification!

1) PROPFIND never returns a 200 code.

2) If a method returns 207, the content type MUST be */xml, and the 
response must have a DAV:multistatus root element.

3) Servers *may* return a */xml response for 4xx and 5xx status codes, 
in which case a client can test for a DAV:error root element or a 
DAV:multistatus element to extract more information.

Julian

-- 
<green/>bytes GmbH -- http://www.greenbytes.de -- tel:+492512807760

---

From: "Stanley Guan" <[email-masked]>
Date: Tue, 4 Nov 2003 12:23:00 -0800

See comments in line!

Thx,

-Stanley

----- Original Message ----- 
From: "Julian Reschke" <[email-masked]>
To: "Stanley Guan" <[email-masked]>
Cc: <[email-masked]>
Sent: Tuesday, November 04, 2003 10:44 AM
Subject: Re: Status Code/Entity body encoded in XML

>   <snip>

How do you come up with the conclusion?  What section of the
spec. says about it?

> DAV:multistatus element to extract more information.

Does the only status codes that servers may return a */xml response include
only:
    4xx, 5xx, and 207?

---

From: "Stanley Guan" <[email-masked]>
Date: Tue, 4 Nov 2003 12:31:51 -0800

> DAV:multistatus element to extract more information.

"DAV:error" seems to be new in "bis".   Do we need a subsection
for it in section 13 of "XML Element Definitions"?

---

From: Julian Reschke <[email-masked]>
Date: Tue, 04 Nov 2003 21:35:20 +0100

> How do you come up with the conclusion?  What section of the

Possibly none. If this is the case, it should be fixed.

> Does the only status codes that servers may return a */xml response include

Servers MAY return */xml on any request. However, the spec only 
specifies what this means for 207, 4xx and 5xx.

Julian

---

From: Julian Reschke <[email-masked]>
Date: Tue, 04 Nov 2003 21:46:40 +0100

> for it in section 13 of "XML Element Definitions"?

Yes (if only for consistency with the current documentation style).