JasperReports®服务器登录无法使用Google App Engine(由于缺少标题属性) [英] JasperReports® Server login not working from Google App Engine (due to missing header attribute)

查看:228
本文介绍了JasperReports®服务器登录无法使用Google App Engine(由于缺少标题属性)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Google App Engine向我在Google Compute Engine上运行的JasperReports服务器进行REST调用(使用Restlet框架)。要使用JasperReports REST接口,您需要首先通过发送POST请求(无主体)和用户名/密码查询参数来登录。

http:/// jasperserver / rest / login?j_username =& j_password =

JasperReports服务器将通过添加Set-Cookie请求标题属性进行响应。属性值包含用于任何后续请求的会话ID,从而跨多个请求保留会话状态。这个属性的一个例子是:

Set-Cookie:JSESSIONID = 488AAF4E493E1FE5BEA25F6D71C025F3;路径= /的JasperServer; HttpOnly



当我使用独立的Apache HTTP客户端时,一切正常。 JR服务器返回Set-Cookie属性,并将其插回任何后续请求(报告执行,报告状态,详细信息等)的标题中。但是,当我尝试在Google App Engine上使用Restlet框架(使用URL下的URLFetchService)执行相同的操作时,从不出现Set-Cookie属性即使JasperReports服务器为登录POST请求返回200 OK状态。



有没有人有使用URLFetchService移除(自定义)响应标头属性的经验? / p>

任何帮助都将非常感谢!

解决方案

响应标题属性将成为Google App Engine的错误,因为文档状态;



https://cloud.google.com /应用服务引擎/文档/标准/ JAVA / outboun d-requests


I'm trying to make a REST call (using the Restlet framework) from Google App Engine to a JasperReports server that I have running on Google Compute Engine. To use the JasperReports REST interface you need to first login by sending a POST request (with no body) and username/password query params.

http:///jasperserver/rest/login?j_username=&j_password=

The JasperReports server will respond by adding a "Set-Cookie" request header attribute. The attribute value contains a session ID that you use for any subsequent requests, thereby preserving session state across multiple requests. An example of this attribute is

Set-Cookie: JSESSIONID=488AAF4E493E1FE5BEA25F6D71C025F3; Path=/jasperserver; HttpOnly

When I use a stand-alone Apache HTTP client, everything works fine. The JR server returns the Set-Cookie attribute and I insert it back into the header of any subsequent requests (report executions, report status, details, etc.).

However, when I try to do the same using the Restlet framework on Google App Engine (which uses the URLFetchService under the hood) the "Set-Cookie" attribute never appears in the response header even though the JasperReports server returns a 200 OK status for the login POST request.

Does anyone have experience with URLFetchService removing (custom) response header attributes?

Any help would be much appreciated!

解决方案

Removing (custom) response header attributes would be an Google App Engine bug because the documentation states;

https://cloud.google.com/appengine/docs/standard/java/outbound-requests

这篇关于JasperReports®服务器登录无法使用Google App Engine(由于缺少标题属性)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆