RTC 简单 ID 查询结果 404?

RTC Simple ID Query Results in 404?

我正在尝试通过 ID 简单地 "find" 一个 RTC 票证,它告诉我 404 未找到。也许我应该用某些东西替换 _ggTXcJdTEeCznlnpJMXHdQ?或爵士乐或 oslc 或上下文或 http://purl.org/dc/terms/? I have no idea what's placeholder or not and what I'm supposed to change to be specific to me from the docs.

    public static void GetTicket(string credentials)
    {
        string localhost = "my.host.com";
        string WtId = "2494443"
        string item = "https://" + localhost + ":9443/jazz/oslc/contexts/_ggTXcJdTEeCznlnpJMXHdQ/workitems?" +
            "oslc.where=dcterms:identifier=%22" + WtId + "%22&" +
            "oslc.properties=dcterms:title,dcterms:identifier&" +
            "oslc.prefix=dcterms=%3Chttp://purl.org/dc/terms/%3E";
        HttpWebRequest request = (HttpWebRequest)WebRequest.Create(item);
        request.Accept = "application/json";
        request.Headers.Add("Authorization", "Basic " + credentials);
        WebResponse response = request.GetResponse();
        // ... more stuff
    }

您的代码来自您提到的文档的“Query Capabilities”部分。

我确认,_ggTXcJdTEeCznlnpJMXHdQ 示例 的一部分,而不是预期在您自己的环境中工作的东西。

discovery mechanism 是关键:

Clients should not rely on specific URLs or perform path math on URLs. Instead, they should use the discovery chain offered by RTC. Here's an outline of the process to find the Change Management functionality:

The root document is exposed at https://<server>:<port>/<app>/rootservices.
In a typical RTC testbed, this is https://localhost:9443/jazz/rootservices

Fetch this document and extract the Change Management Catalog URL (pointed to by rdf:about) of the element oslc:ServiceProviderCatalog

Fetch the document behind this URL. It contains a list of ServiceProvider elements that point to the documents which contain the actual service descriptions.
In the case of RTC, there is one ServiceProvider element for each Project Area. Typically, an application would use the title of this element to allow the user to choose between the project areas.

Fetch the services document pointed to by property rdf:about of element oslc:ServiceProvider.
This document contains references to services and operations like:

  • Creation Factories to create new work items,
  • Query capabilities that allows to query work items,
  • Delegated UI dialogs to create and select work items, and
  • CLM Filters that are pre-defined queries on work items.

只有遵循此发现路径,您才能获得实际的 URL 以用于您的工作项查询。