It's all about the answers!

Ask a question

OSLC GET API doesn't return OSLC resource information of workitem


Izumi Satoh (2621) | asked Apr 12 '18, 8:09 a.m.

With RTC 6.0.5, I'd be able to call successfully OSLC-CM API to get workitem resource information like the following:

[URI]
    https://FQDN/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/xxxxx   
[Request Headers]
    Accept:     application/rdf+xml
    OSLC-Core-Version:  2.0

[Response Body  : Before]
    <?xml version="1.0" encoding="UTF-8"?>   
    <rdf:RDF   
        xmlns:oslc_cmx="http://open-services.net/ns/cm-x#"   
        xmlns:acc="http://open-services.net/ns/core/acc#"   
        xmlns:rtc_cm="http://jazz.net/xmlns/prod/jazz/rtc/cm/1.0/"   
        xmlns:oslc_pl="http://open-services.net/ns/pl#"   
        xmlns:process="http://jazz.net/ns/process#"   
        xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"   
        xmlns:dcterms="http://purl.org/dc/terms/"   
        xmlns:rtc_ext="http://jazz.net/xmlns/prod/jazz/rtc/ext/1.0/"   
        xmlns:oslc="http://open-services.net/ns/core#"   
        xmlns:acp="http://jazz.net/ns/acp#"   
        xmlns:oslc_cm="http://open-services.net/ns/cm#">   
        <oslc_cm:ChangeRequest rdf:about="https://jazz.net/sandbox01-ccm/resource/itemName/com.ibm.team.workitem.WorkItem/4936">   
            <rtc_ext:com.ibm.team.workitem.attribute.busValuePlanned rdf:resource="https://jazz.net/sandbox01-ccm/oslc/enumerations/_LqZEMQrvEei3zsT9qOEHAw/businessValue/businessValue.literal.l0"/>   
            <rtc_cm:filedAgainst rdf:resource="https://jazz.net/sandbox01-ccm/resource/itemOid/com.ibm.team.workitem.Category/_uQdgUArvEei3zsT9qOEHAw"/>   
            <oslc_cm:approved rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean">false</oslc_cm:approved>   
...

--
But someday suddenly I couldn't get the information above, instead, I got the following JavaScript:

[Response Body : Present ]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Redirecting to Jazz.</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
<meta http-equiv="refresh" content="0;url=https://plm-alm-2-1:9443/ccm/web/projects/SystemArea%20Projects%20%28%E5%A4%89%E6%9B%B4%E7%AE%A1%E7%90%86%29#action=com.ibm.team.workitem.viewWorkItem&amp;id=1234">
</head>
<body>
<p>Click <a href="https://plm-alm-2-1:9443/ccm/web/projects/SystemArea%20Projects%20%28%E5%A4%89%E6%9B%B4%E7%AE%A1%E7%90%86%29#action=com.ibm.team.workitem.viewWorkItem&amp;id=1234">here</a> if you are not automatically redirected.</p>
</body>
</html>


I'd like to get the response body of OSLC resource information like before.
Could you give me a clue to solve this problem?

Best regards,
Izumi

One answer



permanent link
Ralph Schoon (55.3k23642) | answered Apr 12 '18, 10:19 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Apr 12 '18, 10:20 a.m.

If you get that response body - and you read it - you will see that it is a HTML page telling you that you need an authentication and the page is telling you you will be redirected.

So basically your requests are not authenticated and you are redirected to a login page. Fix your login.


Comments
Izumi Satoh commented Apr 12 '18, 11:51 p.m.

Thank you for your answer, Ralph.
But an authentication was successfully completed and the page redirected to was the workitem page.

The userID that was used to login has a valid license.


Ralph Schoon commented Apr 13 '18, 1:42 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

If you are redirected to ANY real web page, you failed to send a valid OSLC/REST call or authentication does not work. Check the request headers etc.

Your answer


Register or to post your answer.