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

Error: (406) Not Acceptable when fetching workitem info via OSLC

I'm writing a Java application to fetch the list of all workitems (Id and Title) for a given Project Area via OSLC.


These are the detailed steps I did (in java application): 
-    Send HTTP GET Request for https://<server>:9443/ccm/rootservices 
      - no authentication is required 
      - returns response with XML stream 
-    Parse the response XML stream 
      - Using the xpath (/rdf:Description/oslc_cm:cmServiceProviders/@rdf:resource) 
      - Extract all cmServiceProviders catalogs 
            => returns https://<server>:9443/ccm/oslc/workitems/catalog 
-    Send HTTP GET Request for https://<server>:9443/ccm/oslc/workitems/catalog 
      - response: authRequired 
      - post authentication form with login credentials 
            => authentication successful 
      - Send HTTP GET Request for https://<server>:9443/ccm/oslc/workitems/catalog once again 
            => returns response with XML stream 
-    Parse the response XML stream 
      - Using the xpath (//oslc:ServiceProvider) 
      - Extract my Project area and its corresponding services link 
           => returns https://<server>:9443/ccm/oslc/contexts/<ID>/workitems/services.xml for my project area 
-    Send HTTP GET Request for https://<server>:9443/ccm/oslc/contexts/<ID>/workitems/services.xml 
      - response: authRequired 
      - post authentication form with login credentials 
          => authentication successful 
      - Send HTTP GET Request for https://<server>:9443/ccm/oslc/contexts/<ID>/workitems/services.xml again 
      - post authentication form with login credentials 
  we are getting this error
            => HTTP/1.1 406 Not Acceptable [X-Powered-By: Servlet/3.0, x-com-ibm-team-scenario: 10.118.58.5, Cache-Control: private, max-age=0, must-revalidate, Expires: Fri, 02 Aug 2019 09:45:20 GMT, Content-Language: en-IN, Content-Length: 0, Connection: Close, Date: Fri, 02 Aug 2019 09:45:21 GMT]
---------------------------------------------------------------------------------------------------------------------------------------------------------------
Why there is an “Error: (406) Not Acceptable” from the server at the last  step ??
My internet searches told me to look into my request’s accept header to look for any incompatible data with the server. But It is not clear to me what is going wrong with the accept header ? 




Also, the same authentication has worked for the previous GET requests like:

https://<server>:9443/ccm/oslc/workitems/catalog

https://<server>:9443/ccm/oslc/contexts/<ID>/workitems/services.xml

Then, why the same authentication fails for the GET request for:

https://<server>:9443/ccm/oslc/contexts/<ID>/workitems

Could you please help ? Thanks in advance. 

0 votes

Comments

What are the request headers you send with the GET? 

1."Accept", "application/rdf+xml"

2."OSLC-Core-Version", "2.0"

These headers we are sending with the GET request. 



One answer

Permanent link

 1. See https://rsjazz.wordpress.com/2019/05/13/using-a-rest-client-to-authenticate-to-elm-clm-applications/ and understand authentication

2. I authenticated and then followed your steps with Postman and I received correct data (even leaving out the accept and the oslc header in the beginning)

0 votes

Comments

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

Question asked: Aug 02 '19, 2:59 a.m.

Question was seen: 1,981 times

Last updated: Aug 02 '19, 8:22 a.m.

Confirmation Cancel Confirm