0

We have implemented a 2-way integration with HP ALM 12.5 through REST API in Java., and trying to get the requirement details by Req ID and getting the following response.

405 Method Not Allowed Exception

qccore.method-not-allowedMethod not allowedjavax.ws.rs.WebApplicationException

This occurs when we try to hit the requirements URL (GET) (/qcbin/rest/domains/domain_name/projects/project_name/requirements/req_id) and server URL (qcbin/rest/server). But we are able to get the valid responses through browser and Postman (API Testing Tool) Before hitting the above URLs, we had hit the authentication URL and session URL. And able to authenticate and create QC session with valid responses.

The same code is working for QC version 12. So I would like to know on what may cause this issue and what are the valid/mandatory request headers for the above URLs (It is not very clear in 12.5 documentation).

Jesh
  • 63
  • 3
  • 9

1 Answers1

0

While creating QC session, it returns few values through header. You need to add those headers in your next request, so that ALM will consider this request as authentic.

Request

POST /qcbin/api/authentication/sign-in HTTP/1.1
Authorization: Basic 123456789abcdef=
Host: myserver:8081

Response

HTTP/1.1 200 OK
Set-Cookie: LWSSO_COOKIE_KEY=0123456789abcdef;Path=/;HTTPOnly
Set-Cookie: QCSession=0123456789abcdef;Path=/;HttpOnly
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Set-Cookie: ALM_USER=0123456789abcdef;Path=/
Set-Cookie: XSRF-TOKEN=0123456789abcdef;Path=/
Content-Length: 0

You said that same code is working with ALM 12 and not working with ALM 12.50. There is one small difference in response headers i.e. one additional parameter JSESSIONID. You need to remove it and add remaining values to request header.(See both format below)

ALM 12.20

QCSession=NzgwMzQ3O0ZMVHlxQkRqTFl6a2dYVTBxSTRNUHcqKjtSRVNUIGNsaWVudDsgOyA.;Path=/;HttpOnly,ALM_USER=cfbff47427fb68609fc3d9b0c28b81a6b4d7621a5c81cf5170fb7da07b92c54f;Path=/,XSRF
TOKEN=b6751c6e0ffee3ab380bce6d776f8e305fb3c39751f37925540d4f404024a7dd; Path=/

ALM 12.50

**JSESSIONID=1ewklokpzynt61b4tbjiqt1ab6**;Path=/qcbin;HttpOnly,QCSession=MjA3NTt6USsrR044ZUgxQ2V6VkNTNXdJRmF3Kio7UkVTVCBjbGllbnQ7IDsg;Path=/;HttpOnly,ALM_USER=5b575afb206ccbfc1ba967adf989d6becda41dd64aa82efdd3b6a186bad396a6;Path=/,XSRF-TOKEN=b8b79be120e7c095a3755e57e5d2954653b3efe3b3e60503892988bd9ac69a03;Path=/
gelliott181
  • 1,008
  • 11
  • 19