RetrieveServiceMetadata Request

The purpose of the RetrieveServiceMetadata Request is to enable a client to retrieve the conceptual schema definition language (CSDL) document, as specified in [MC-CSDL], describing the data model associated with the data service. AtomPub, as specified in [RFC5023], does not define the usage of an Entity Data Model, as specified in [MC-CSDL], with data services. As such, this request type is not based on any AtomPub-defined [RFC5023] request.

A RetrieveServiceMetadata Request MUST use the HTTP GET method and the URI specified by the client in the HTTP request line MUST be a valid data service URI, that identifies the $metadata endpoint of a data service, as specified in URI Syntax (section

If the RetrieveServiceMetadata Request was successful, the response MUST have a 200 status code, as specified in [RFC2616], and the response body MUST be formatted as specified in Conceptual Schema Definition Language Document for Data Services (section If the RetrieveServiceMetadata Request is not successful (for example, an error occurred while processing the request), the response MUST be formatted according to Error Response (section The version number returned as the value of the DataServiceVersion response header MUST match the value of the DataServiceVersion attribute (section in the returned EDMX [MC-EDMX] document.

The syntax of a RetrieveServiceMetadata Request is defined as follows:

 retrieveServiceMD-Req         = retrieveServiceMD-ReqLine
 retrieveServiceMD-ReqLine     = "GET"
                                 SP serviceRootNoHost
                                 SP HTTP-Version
 retrieveServiceMD-ReqHeaders  = [DataServiceVersion]        ; see section
                                 [MaxDataServiceVersion]     ; see section
 serviceRootNoHost = <the ServiceRoot section of the data service URI
                     beginning after  the definition of the host>
                      ; see section
 retrieveServiceMD-QueryOps    = ["?" customQueryOption *("&" customQueryOption)]
                                  ; see section

The syntax of a response to a successful RetrieveServiceMetadata Request is defined as follows:

 retrieveServiceMD-Resp       = Status-Line           ; see [RFC2616] section 6.1.1
 retrieveServiceMD-RespHeaders= DataServiceVersion          ; see section
                                [Content-Type]              ; see section
 retrieveServiceMD-RespBody   = <CSDL-based document describing the data model
                                 defining the data service>
                                ; see section