HttpClient.execute(request) issue
![](http://jazz.net/_images/myphoto/cd906c2e5a04c1c047ca065930b20510.jpg)
Hi all
I do not know what has happened. It worked before, but suddenly I can't use my rest-script for logging into e.g. service provider catalog .
My response header looks as follows:
>> Response Headers:
- X-com-ibm-team-repository-web-auth-msg: authrequired
- Content-Type: text/html; charset=UTF-8
- Content-Language: en-US
- Set-Cookie: JazzFormAuth=Form; Path=/jazz
- Transfer-Encoding: chunked
- Date: Mon, 31 Mar 2014 09:38:58 GMT
- Server: WebSphere Application Server/7.0
- Expires: Thu, 01 Dec 1994 16:00:00 GMT
- Cache-Control: no-cache="set-cookie, set-cookie2"
I would have expected something like this:
>> Response Header:
- OSLC-Core-Version: 2.0
- Content-Type: application/rdf+xml
- Content-Language: en-US
- Transfer-Encoding: chunked
- Date: Mon, 31 Mar 2014 09:40:30 GMT
- Server: WebSphere Application Server/7.0
When debugging I see that my response status line is 200 and the header == null, thus this line
boolean loginWasRequired = doRRCOAuth(documentResponse, login, password, httpClient, jtsURI);
in my HttpUtils.java returns false.
Does any of you have any good solutions for this?
I do not know what has happened. It worked before, but suddenly I can't use my rest-script for logging into e.g. service provider catalog .
My response header looks as follows:
>> Response Headers:
- X-com-ibm-team-repository-web-auth-msg: authrequired
- Content-Type: text/html; charset=UTF-8
- Content-Language: en-US
- Set-Cookie: JazzFormAuth=Form; Path=/jazz
- Transfer-Encoding: chunked
- Date: Mon, 31 Mar 2014 09:38:58 GMT
- Server: WebSphere Application Server/7.0
- Expires: Thu, 01 Dec 1994 16:00:00 GMT
- Cache-Control: no-cache="set-cookie, set-cookie2"
I would have expected something like this:
>> Response Header:
- OSLC-Core-Version: 2.0
- Content-Type: application/rdf+xml
- Content-Language: en-US
- Transfer-Encoding: chunked
- Date: Mon, 31 Mar 2014 09:40:30 GMT
- Server: WebSphere Application Server/7.0
When debugging I see that my response status line is 200 and the header == null, thus this line
boolean loginWasRequired = doRRCOAuth(documentResponse, login, password, httpClient, jtsURI);
in my HttpUtils.java returns false.
Does any of you have any good solutions for this?
One answer
![](http://jazz.net/_images/myphoto/cd906c2e5a04c1c047ca065930b20510.jpg)
Normally when executing my request via httpClient.execute(request) I get the following:
31-03-2014 13:22:41 org.apache.http.client.protocol.ResponseProcessCookies processCookies
WARNING: Invalid cookie header: "Set-Cookie: jfs-request-token-6fa84612badf9b4ee5e6b2877c3e0="z4N5pTdq4lX3YAeTkbZjqJhPPuh7qWeS7rE44uxk"; Version=1; Max-Age=600; Expires=Mon, 31-Mar-2014 11:32:40 GMT; Path=/rm". Unable to parse expires attribute: Mon
31-03-2014 13:22:41 org.apache.http.impl.client.DefaultRequestDirector handleResponse
WARNING: Authentication error: Unable to respond to any of these challenges: {oauth=WWW-Authenticate: OAuth realm=myServer:9443/jts/oauth-authorize}
However I'm not getting this now.
31-03-2014 13:22:41 org.apache.http.client.protocol.ResponseProcessCookies processCookies
WARNING: Invalid cookie header: "Set-Cookie: jfs-request-token-6fa84612badf9b4ee5e6b2877c3e0="z4N5pTdq4lX3YAeTkbZjqJhPPuh7qWeS7rE44uxk"; Version=1; Max-Age=600; Expires=Mon, 31-Mar-2014 11:32:40 GMT; Path=/rm". Unable to parse expires attribute: Mon
31-03-2014 13:22:41 org.apache.http.impl.client.DefaultRequestDirector handleResponse
WARNING: Authentication error: Unable to respond to any of these challenges: {oauth=WWW-Authenticate: OAuth realm=myServer:9443/jts/oauth-authorize}
However I'm not getting this now.