3.2 Put

This specification defines one Web service operation (Put) for updating a resource by providing a replacement representation. This operation MAY be supported by compliant WS-Transfer resources. A resource MAY accept updates that provide different XML representations than that returned by the resource; in such a case, the semantics of the update operation is defined by the resource.

Unless otherwise specified by an extension, this operation will replace the entire XML representation of the resource with the resource representation in the Put request message, or if the Put request message contains instructions, update the XML representation based on those instructions. When this operation is used to replace the entire XML representation, and any OPTIONAL values (elements or attributes) not specified in the Put request message will be set to a resource-specific default value.

The Put request message MUST be of the following form:

[Action]

  http://www.w3.org/2009/09/ws-tra/Put

 

[Body]

  <wst:Put Dialect="xs:anyURI"? ...>

    xs:any*

  </wst:Put>

The following describes additional, normative constraints on the outline listed above:

[Body]/wst:Put

This REQUIRED element MUST have as its first child element, an element that comprises the representation of the resource that is to be replaced or instructions for updating the resource.

[Body]/wst:Put@Dialect

When this OPTIONAL attribute is present it contains a IRI that refers to additional information for the service on how to process this element. If the attribute is present but the dialect IRI is not known then the service MUST generate an wst:UnknownDialect fault. There is no default value for the attribute. If the attribute is absent, then the base behavior is used.

[Body]/wst:Put@Dialect="http://www.w3.org/2009/09/ws-fra"

The WS-Fragment [WS-Fragment] specification defines this dialect IRI. Use of this IRI indicates that the contents of the Put element MUST be processed as specified by the WS-Fragment [WS-Fragment] specification.

If the request message reaches a conformant implementation of WS-Transfer and the message refers to an unknown resource, then the implementation MUST generate a wst:UnknownResource fault.

A Put request MUST be targeted at the resource whose representation is desired to be replacedupdated, as described in 2 Terminology and Notation of this specification.

If an implementation that performs schema validation on a presented representation detects that the presented representation is invalid for the target resource, then the implementation MUST generate a wst:InvalidRepresentation fault. The replacement representation could be considered to be invalid if it does not conform to the schema(s) for the target resource or otherwise violates some cardinality or type constraint.

The replacement representation could contain within it element or attribute values that are different than their corresponding values in the current representation. Such changes could affect elements or attributes that, for whatever reason, the implementation does not wish to allow the client to change. An implementation MAY choose to ignore such elements or attributes. If an implementation does not ignore those elements or attributes, it MUST generate a wst:PutDenied fault. See 5 Faults.

Other components of the outline above are not further constrained by this specification.

A successful Put operation updates the current representation associated with the targeted resource. An unsuccessful Put operation does not affect the resource.