My guess is that the JSESSIONID (or whichever session cookie used by the 
service) that is received in the HTTPResponse of your first fetch() is not 
sent back with your second fetch. As a consequence, the service does not 
know you're logged in. Here is how I would solve it (I did not test that 
code):

// ...
HTTPResponse response = urlFetchService.fetch(httpRequest);
List<HTTPHeader> headers = response.getHeaders();
String cookies;
for (HTTPHeader header : headers)
  if ("Set-Cookie".equals(header.getName())
    cookies = header.getValue();
httpRequest = new HTTPRequest(url,HTTPMethod.POST, validateCertificate());
if (cookies != null)
  httpRequest.setHeader(new HTTPHeader("Cookie", cookies));
// ...

You may run into the following issues, though:
  http://code.google.com/p/googleappengine/issues/detail?id=1704
  http://code.google.com/p/googleappengine/issues/detail?id=3379

Hope it helps,
   Philippe

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to