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

From: Dean Willis <[email-masked]>
Date: Thu, 25 Aug 2005 15:16:22 -0500

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

---

From: Miguel Garcia <[email-masked]>
Date: Fri, 26 Aug 2005 11:12:06 +0300

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:

> Access Protocol, (XCAP), draft-ietf-simple-xcap-07" section 8.2.6 states 
> "If the creation or insertion was successful, and the resource 

-- 
Miguel A. Garcia           tel:+358-50-4804586
sip:[email-masked]
Nokia Research Center      Helsinki, Finland