It's all about the answers!

Ask a question

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


Ravindra Dhere (112) | asked Aug 02 '19, 6:07 a.m.
closed Aug 02 '19, 6:11 a.m. by Ralph Schoon (63.1k33646)

 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 ?

The question has been closed for the following reason: "Duplicate Question" by rschoon Aug 02 '19, 6:11 a.m.

One answer



permanent link
Ralph Schoon (63.1k33646) | answered Aug 02 '19, 6:11 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 I would strongly suggest you and your colleague coordinate forum questions.