[英]Mule Set JSESSIONID from first into 2nd REST request or how to put the cookie through
for my Thesis I'm integrating Bonita BPM into a Mule SOA. 对于我的论文,我正在将Bonita BPM集成到Mule SOA中。
To start a new case or process-instance in Bonita I have to call the Bonita REST. 要在Bonita中启动新案例或流程实例,我必须调用Bonita REST。 First I have to authenticate with that Bonita REST. 首先,我必须使用Bonita REST进行身份验证。 And here starts my problem. 这里开始我的问题。
The authentication works like "You have to call the loginservice and put the responding cookie in all future request". 身份验证的工作方式类似于“您必须调用loginservice并将响应cookie放在以后的所有请求中”。
How could this be done inside a mule flow ? 怎么可能在骡子流中完成? Some articles told me that copy-properties propertyName="JSESSIONID" should do that. 有些文章告诉我,copy-properties propertyName =“JSESSIONID”应该这样做。 But this does not work. 但这不起作用。
Does anybody have a idea ? 有人有想法吗?
Further heres my flow and the related print messages: 继续我的流程和相关的打印消息:
PRINT1 : CopyPropertiesTransformer: Property value for is null, no property will be copied PRINT1:CopyPropertiesTransformer:属性值为null,不会复制任何属性
PRINT 2 : LoggerMessageProcessor: {Set-Cookie=JSESSIONID=F60114E3ECB450A62171E3D63EAC3E4D; PRINT 2:LoggerMessageProcessor:{Set-Cookie = JSESSIONID = F60114E3ECB450A62171E3D63EAC3E4D; Path=/bonita/; 路径= /博尼塔/; HttpOnly} 仅Http}
PRINT 3 : Response code 401 mapped as failure. 打印3:响应代码401映射为失败。 Message payload is of type: BufferInputStream 消息有效内容的类型为:BufferInputStream
<http:request-config name="bos" host="localhost"
port="8080" basePath="/bonita" doc:name="bos-connection" />
<flow name="sendOrderFlow">
<http:listener config-ref="HTTP_Listener_Configuration"
path="/" doc:name="HTTP" />
<http:request config-ref="bos" path="loginservice"
method="GET" followRedirects="false" doc:name="bos-login">
<http:request-builder>
<http:query-param paramName="username" value="walter.bates" />
<http:query-param paramName="password" value="bpm" />
</http:request-builder>
</http:request>
<copy-properties propertyName="JSESSIONID" /> <!-- PRINT 1 HERE -->
<logger message="#[headers:INBOUND:Set-Cookie]" level="INFO" /> <!-- PRINT 2 HERE -->
<http:request config-ref="bos"
path="API/bpm/process" method="GET" followRedirects="false" doc:name="bos-listAvailableProcesses">
<http:request-builder>
<http:query-param paramName="p" value="0" />
</http:request-builder>
</http:request>
Additionally to JSESSIONID you also need to include X-Bonita-API-Token in HTTP header. 除了JSESSIONID之外,您还需要在HTTP标头中包含X-Bonita-API-Token。 The value of this header is provide as a cookie sent with the answer to the authentication (ie the call to loginservice). 此标头的值作为cookie发送,其中包含对身份验证的答案(即对loginservice的调用)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.