Camel CXFRS客户端端点 - 基本身份验证设置 - Cookie标头空

时间:2018-03-26 16:31:01

标签: java cookies apache-camel cxfrs cxf-client

首先抱歉我的英语不好!

情况:

我目前在Jboss Fuse 6.3上使用Camel(2.17),Blueprint和CXF Rest Client。 我尝试使用CXF-RS使用者(客户端)端点调用RESTFUL Web服务(服务器)。使用Basic Auth进行身份验证,并尝试使用响应中的身份验证cookie(Set-Cookie)进行进一步请求。 Camel中的rsClient端点作为普通HTTP客户端运行。

问题:

Everthing似乎运行良好,我可以调用目标Web服务。来自cxf的出站和入站消息看起来非常好。入站响应设置并填充了set-cookie-header。 在CXF端点完成其工作后,路由进一步...标题" Set-Cookie"缺少/空!我用日志端点检查它,甚至使用驼峰处理器bean。交易所不包含" set-cookie"标头了。 我也尝试使用camel-http4端点,然后是" Set-Cookie"标头得到了正确维护。

在这种情况下,我做错了什么?

我的简单骆驼路线如下:

<route id="_route1">
 <from id="_from1" uri="timer:timerName?repeatCount=1"/>
 <to id="_to1" uri="cxfrs:bean:rsClient"/>
 <to id="_log1" uri="log:com.mycompany.test?showAll=true&amp;multiline=true"/>
</route>

我的CXF Rest客户端配置:

 <cxf:rsClient address="https://mywebservice/rest" id="rsClient"
        loggingFeatureEnabled="true"
        password="pass"
        username="user"
        serviceClass="org.MyInterface">
 </cxf:rsClient>

使用http4路线:

<route id="_route1">
 <from id="_from1" uri="timer:timerName?repeatCount=1"/>
 <to id="_to1" uri="http4://mywebservice/rest?authMethod=Basic&amp;authUsername=user&amp;authPassword=pass"/>
 <to id="_log1" uri="log:com.mycompany.test?showAll=true&amp;multiline=true"/>
</route>

谢谢!

0 个答案:

没有答案