Delen via


AtomPubClient.RetrieveServiceDocumentAsync(Uri) Method

Definition

Retrieves a service document from the specified Uri.

public:
 virtual IAsyncOperationWithProgress<ServiceDocument ^, RetrievalProgress> ^ RetrieveServiceDocumentAsync(Uri ^ uri) = RetrieveServiceDocumentAsync;
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperationWithProgress<ServiceDocument, RetrievalProgress> RetrieveServiceDocumentAsync(Uri const& uri);
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperationWithProgress<ServiceDocument,RetrievalProgress> RetrieveServiceDocumentAsync(System.Uri uri);
function retrieveServiceDocumentAsync(uri)
Public Function RetrieveServiceDocumentAsync (uri As Uri) As IAsyncOperationWithProgress(Of ServiceDocument, RetrievalProgress)

Parameters

uri
Uri Uri

The specified Uri.

Returns

The object that is used to retrieve the service document asynchronously and to report the progress and completion status of the operation.

Attributes

Examples

The following code demonstrates how to access a service document and retrieve edit URI values. For additional examples of how AtomPub can be used to manage feed content, download the AtomPub sample.

function findEditUri(serviceUri) {
    return client.retrieveServiceDocumentAsync(serviceUri).then(function (serviceDocument) {
        for (var i in serviceDocument.workspaces) {
            var workspace = serviceDocument.workspaces[i];
            for (var j in workspace.collections) {
                var collection = workspace.collections[j];

                if (collection.accepts.join(";") === "application/atom+xml;type=entry") {
                    return collection.uri;
                }
            }
        }

        return null;
    });
}

Applies to

See also