Subject: Re: [Simple] XCAP Question on Response Code for Insert

From: Dean Willis <[email-masked]>
Date: Fri, 2 Sep 2005 00:20:45 -0500

I dunno. I went back and re-read it, and now I'm more confused than 
ever. So maybe it's not THAT clear. Or maybe I'm just "having a stupid 
year".

I read that a 200 is returned on creation of a new "whole document" 
(roughly corresponding to a WebDAV "collection"), and that 
201-with-diff is returned on insertion OR replacement of a resource.

--
Dean

On Aug 26, 2005, at 3:12 AM, Miguel Garcia wrote:

> Dean:
>
> I guess you swapped the semantics of 200 and 201 in your post.
>
> A 200 is returned as a successful replacement
>
> A 201 is returned as a succesful creation of a new resource (including 
> the xca-diff document)
>
> In my opinion XCAP is clear if you consider the normative dependency 
> to RFC 2616.
>
> /Miguel
>
> Dean Willis wrote:
>
>> Here's the question as it was asked me:
>> "Problem Summary:
>> In the document: "The Extensible Markup Language (XML)Configuration 
>> Access Protocol, (XCAP), draft-ietf-simple-xcap-07" section 8.2.6 is 
>> unclear regarding a server response to a PUT request.
>> Problem Text:
>> In the document: "The Extensible Markup Language (XML)Configuration
>> Access Protocol, (XCAP), draft-ietf-simple-xcap-07" section 8.2.6 
>> states "If the creation or insertion was successful, and the resource 
>> interdependencies are resolved, the server returns a 200 OK or 201 
>> Created, as appropriate."
>> What is the appropriate response when inserting an element or 
>> attribute into a pre-existing document?"
>> -------
>> My read:
>> A 200 is returned on a successful creation.
>> A 201 is returned on a successful insertion, and a diff with a single 
>> document element and before-and-after etags is returned.
>> This suggests that the answer to the above question is "A 201 
>> response".
>> Section 7.4 of XCAP (Insertion) says:
>>    Once the client constructs the URI, it invokes the HTTP PUT method.
>>    If the client is creating a new element, it SHOULD include
>>    "application/xcap-diff+xml" in the Accept header field of the
>>    request.  This allows the server to return an XCAP Diff document 
>> in a
>>    201 response code, and is useful for subsequent conditional
>>    operations, as described in Section 7.10.  The content in the 
>> request
>>    MUST be an XML element.  Specifically, it contains the element,
>>    starting with the opening bracket for the begin tag for that 
>> element,
>>    including the attributes and content of that element (whether it be
>>    text or other child elements), and ending with the closing bracket
>>    for the end tag for that element.  The MIME type in the request 
>> MUST
>>    be "application/xcap-el+xml", defined in Section 14.2.1.  If the 
>> node
>>    selector, when evaluated against the current document, results in a
>>    no-match, the server performs a creation operation.  If the node
>>    selector, when evaluated against the current document, is a match 
>> for
>>    an element in the current document, the server replaces it with the
>>    content of the PUT request.  This replacement is complete; that is,
>>    the old element (including its attributes and content) are removed,
>>    and the new one, including its attributes and content, is put in 
>> its
>>    place.
>> Does that sound right?
>> -- 
>> Dean
>> _______________________________________________
>> Simple mailing list
>> [email-masked]
>> https://www1.ietf.org/mailman/listinfo/simple
>
> -- 
> Miguel A. Garcia           tel:+358-50-4804586
> sip:[email-masked]
> Nokia Research Center      Helsinki, Finland
>
>
> _______________________________________________
> Simple mailing list
> [email-masked]
> https://www1.ietf.org/mailman/listinfo/simple
>

_______________________________________________
Simple mailing list
[email-masked]
https://www1.ietf.org/mailman/listinfo/simple

---

From: Miguel Garcia <[email-masked]>
Date: Fri, 02 Sep 2005 08:47:08 +0300

We agree on one thing: if we are having this discussion, it is not clear.

If you go back to RC 2616, Section 10.2.2 explains the semantics of the 
201 Created response:

   "The request has been fulfilled and resulted in a new resource being
    created."

Section 10.2.1 attempts to define the semantics for 200 OK, merely 
indicating that "the request has succeeded", provides a dependency on 
the HTTP request (GET, HEAD, POST, and TRACE), but not PUT.

I am not sure if the spirit of XCAP is to differentiate in a response 
whether the creation was for the whole document or for an element or 
attribute. The spec. refers to resources, which can be the whole 
document or an element or attribute.

But certainly this deserves a clarification in one or the other sense.

/Miguel

Dean Willis wrote:
> (roughly corresponding to a WebDAV "collection"), and that 201-with-diff 
> is returned on insertion OR replacement of a resource.
> 
> -- 
> Dean
> 
> 
>>> This suggests that the answer to the above question is "A 201 response".
>>>    request.  This allows the server to return an XCAP Diff document in a
>>>    operations, as described in Section 7.10.  The content in the request
>>>    starting with the opening bracket for the begin tag for that element,
>>>    for the end tag for that element.  The MIME type in the request MUST
>>>    be "application/xcap-el+xml", defined in Section 14.2.1.  If the node
>>>    selector, when evaluated against the current document, is a match for
>>>    and the new one, including its attributes and content, is put in its
>>>    place.
>>> Does that sound right?
>>> -- 
>>> Dean