Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

About creating RTC WI with OSLC

Hello.
I need to create a java client that can talk with RTC (4.0.1) via OSLC, to create/read/update WI.
I started with installing the OSLC4J 1.1. project (eclipse lyo),and running the RTCFormSample provided with it.

WIs query and update work fine, but the "create" of a ChangeRequest (WI) fails.
To be more exact, it simply doesn't work, since it does not throw any exception/error.

The code in the sample is:

//Create the change request
ClientResponse creationResponse = client.createResource(
                           changeRequestCreation, changeRequest,
                           OslcMediaType.APPLICATION_RDF_XML,
                           OslcMediaType.APPLICATION_RDF_XML);

String changeRequestLocation = creationResponse.getHeaders().getFirst(HttpHeaders.LOCATION);

You can realize that "create" fails since the "changeRequestLocation" is null.

I have debugged a little bit the code, and I found that the ClientResponse fields "status" and "message" are respectively "403" and "forbidden".

Since I'm quite sure that credentials are correct, and they are allowed to create a WI (I've verified from RTC WUI), have you any idea what could be the problem?

Could it be the version of the OSLC libraries?

thanks in advance 

0 votes



2 answers

Permanent link
Hi Pietro,

try to check the body of the ClientResponse. RTC usually provides additional error messages there, similar to this one:
  <oslc:Error>
    <oslc:message>Unexpected identifier "asdf": line 1, column 6</oslc:message>
    <oslc:statusCode>400</oslc:statusCode>
  </oslc:Error>
Hope that helps,
 Oliver

0 votes


Permanent link
Hi Pietro,
Did you solved the problem?

thanks
marina

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,927

Question asked: May 15 '13, 4:03 p.m.

Question was seen: 4,162 times

Last updated: Oct 22 '14, 5:16 a.m.

Confirmation Cancel Confirm