6.2 GetMetadata

A requester MAY send a GetMetadata request message to an endpoint to retrieve the metadata associated with that endpoint. This operation MAY be supported by WS-MetadataExchange compliant service endpoints. Observe that, in the case where a service endpoint is also a [WS-Transfer] resource, the [WS-Transfer] Get operation allows requesters to retrieve the resource representation associated with that endpoint (i.e. the "data"), while the GetMetadata operation can be used to retrieve that endpoint's metadata. The normative outline for a GetMetadata request is:

[Action]
  http://www.w3.org/2010/08/ws-mex/GetMetadata
 
[Body]
  <mex:GetMetadata Content='xs:anyURI' ? ...>
    <mex:Dialect Type='xs:QName'
                 Identifier='xs:anyURI' ?
                 Content='xs:anyURI' ? .../> *
    xs:any*
  </mex:GetMetadata> 

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

[Body]/mex:GetMetadata@Content

This OPTIONAL attribute, when present, specifies the default content form IRI for this request.   When this attribute is not present, the default content form IRI is "http://www.w3.org/2010/08/ws-mex/Content/Any".

If no dialect elements are present in this request, the response MUST include only MetadataSections of the content form specified by this attribute.

This specification defines the following content form IRIs:

Content Form IRI

Form

http://www.w3.org/2010/08/ws-mex/Content/EPR

A MetadataReference element is returned

http://www.w3.org/2010/08/ws-mex/Content/URI

A MetadataLocation element is returned

http://www.w3.org/2010/08/ws-mex/Content/Metadata

The metadata is embedded

http://www.w3.org/2010/08/ws-mex/Content/Any

The service is free to choose any content form

http://www.w3.org/2010/08/ws-mex/Content/All

The service MUST return all available content forms

 

[Body]/mex:GetMetadata/mex:Dialect

When this repeating OPTIONAL element is present, the response MUST include only MetadataSections corresponding to metadata specified by the combination of the QName, Identifier and Content attributes of each of the Dialect elements. For each Dialect element if there is no metadata for that combination of attributes then the response MUST NOT include any MetadataSections for that Dialect element.

When this element is not present, the endpoint MUST return all available metadata.

[Body]/mex:GetMetadata/mex:Dialect@Type

This REQUIRED attribute specifies the Metadata Dialect. The response MUST only include MetadataSections corresponding to the Dialect specified by this QName. If the receiver does not have any MetadataSections of this indicated Dialect, the response MUST include zero MetadataSections for this QName.

[Body]/mex:GetMetadata/mex:Dialect@Identifier

When this OPTIONAL attribute is present, the response MUST include only MetadataSections with the indicated identifier; if the receiver does not have any MetadataSections of the indicated identifier, the response MUST include zero MetadataSections for this QName/Identifier pair. When this attribute is not present, the implied value is any identifier. If multiple MetadataSections have the indicated Dialect and Identifier then all of them MUST be returned.

[Body]/mex:GetMetadata/mex:Dialect@Content

For the dialect indicated, the response MUST include only MetadataSections of the content form specified by this attribute.

When this OPTIONAL attribute is not present, it defaults to the value of the [Body]/mex:GetMetadata@Content attribute. 

the response MUST include only MetadataSections of this specified content form. If the specified content form is not available, or not known, then the response MUST include zero MetadataSections of the specified form for this QName/Identifier pair. This specification defines the following content form IRIs:

Content Form IRI

Form

http://www.w3.org/2010/08/ws-mex/Content/EPR

A MetadataReference element is returned

http://www.w3.org/2010/08/ws-mex/Content/URI

A MetadataLocation element is returned

http://www.w3.org/2010/08/ws-mex/Content/Metadata

The metadata is embedded

http://www.w3.org/2010/08/ws-mex/Content/Any

The service is free to choose any content form

http://www.w3.org/2010/08/ws-mex/Content/All

The service MUST return all available content forms

When not present the default value is "http://www.w3.org/2010/08/ws-mex/Content/Any".

If an endpoint accepts a GetMetadata request, it MUST reply with a GetMetadataResponse message. The normative outline for a GetMetadataResponse is:

[Action]
  http://www.w3.org/2010/08/ws-mex/GetMetadataResponse
 
[Body]
  <mex:GetMetadataResponse ...>
    <mex:Metadata ...> ... </mex:Metadata>
    xs:any*
  </mex:GetMetadataResponse>

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

[Body]/mex:GetMetadataResponse/mex:Metadata

The body of the response message MUST contain one mex:Metadata element as defined in 4 Web Services Metadata Collection.

This operation is safe; it will not result in any side effect imputable to the requester. This means that in case of an underlying protocol error that might get unnoticed, resending the same request can be done automatically.