It's all about the answers!

Ask a question

Cannot Acces OSLC Service Providers Catalog due to Authentication Error


Andrew Trobec (49712143139) | asked Jun 19 '13, 4:22 a.m.
edited Jun 19 '13, 4:23 a.m.
Hello,

I have an RTC 4.0.0.1 installation and I am currently following the Open Services for Lifecycle Collaboration Workshop.  Instead of having a local server running, I have an actual RTC production environment..

I have managed to successfully run Example01 (how to access to the Root Services document) and Example02 (how to retrieve an attribute value) but I cannot complete Example03 (using form-based authentication to access the Service Providers catalog and list the Service Providers currently available) due to an authentication error.

The code is divided into two steps: (1) Request the Root Services document and parse the service provider catalog and (2) Access the service provider catalog and parse the service providers.  Step 1 works find and I can retrieve the service provider catalog URI.  The authentication error happens during step two when I have to access the URI.  Instead of getting status code 200 and proceeding, I get status code 401 Unauthorized:

HttpResponse catalogResponse = HttpUtils.sendGetForSecureDocument(server, catalogDoc, login, password, httpclient);

When I access the URI in Firefox with RESTClient I can retrieve the XML document.  The username and password that I use are the same as what I am using in Example03.  I have tried to manually insert the URI into the code instead of retrieving it in the first step, but I still get the same error.

What could be the causing the problem?

Best regards,

Andrew

One answer



permanent link
Dinesh Kumar B (4.1k413) | answered Jun 19 '13, 5:15 a.m.
JAZZ DEVELOPER
i had similar issues.. making httpclient a global variable helped my cause... you may want to try that...

Comments
Andrew Trobec commented Jun 19 '13, 5:34 a.m.

Hello Dinesh,


I tried defining httpclient as a global variable

public static HttpClient httpclient;

but it didn't help.

Regards,

Andrew

Your answer


Register or to post your answer.