如何使 wss4j 不在肥皂头中创建过期元素
wss4j 或 cxf 中是否有任何选项可以控制 ws-security 中的
元素是否包含在 SOAP 标头中。
我想要实现的是 SOAP 标头仅包含
元素,例如
<wsu:Timestamp wsu:Id="Timestamp-2" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsu:Created>2011-12-07T14:39:03Z</wsu:Created>
</wsu:Timestamp>
我正在使用 wss4j 1.5.10 和 cxf 2.3.x
请注意 xsd 架构 时间戳有
<xsd:element ref="wsu:Expires" minOccurs="0"/>
Is there any option in wss4j or cxf that controls whether <expires>
element from ws-security is included in SOAP header.
What I want to achieve is that SOAP header contains only <created>
element, e.g.
<wsu:Timestamp wsu:Id="Timestamp-2" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsu:Created>2011-12-07T14:39:03Z</wsu:Created>
</wsu:Timestamp>
I'm using wss4j 1.5.10 and cxf 2.3.x
Note that xsd schema for timestamp has
<xsd:element ref="wsu:Expires" minOccurs="0"/>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我需要同样的东西,但无法在任何地方找到答案。
最后,我研究了源代码,并扩展了
WSS4JOutInterceptor
并以这种方式重写了decodeTimeToLive
方法:也许不美观,但它对我有用。
I needed the same thing and wasn't able to find an answer anywhere.
At the end I studied the source and did it extending the
WSS4JOutInterceptor
and rewriting the methoddecodeTimeToLive
this way:Maybe not beautiful, but it worked for me.
我认为您将 timeToLive 设置为一个较小的值创建将等于过期并且不会添加过期信息
I think that of you set timeToLive to a small value created will be equal to expire and the expires info is not added