我试图通过 ID 简单地“查找”RTC 票证,但它告诉我 404 未找到。也许我应该用一些东西替换 _ggTXcJdTEeCznlnpJMXHdQ ?或爵士乐或oslc或上下文或http://purl.org/dc/terms/ ?我不知道什么是占位符,也不知道我应该从 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
是示例的一部分,而不是预期在您自己的环境中工作的内容。
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 ishttps://localhost:9443/jazz/rootservices
Fetch this document and extract the Change Management Catalog URL (pointed to by
rdf:about
) of the elementoslc: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 oneServiceProvider
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 elementoslc: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。
关于rational-team-concert - RTC简单ID查询结果404?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61108722/