WSS4j elements order during signing SOAP message

*爱你&永不变心* 提交于 2019-12-05 08:15:29

The WS-SEC specification says "As elements are added to a header block, they SHOULD be prepended to the existing elements."

So if you first add the timestamp it will be above any existing child elements in the ws-header. Since you are signing message after adding the timstamp, the signing info will be again preappended to the header, thus it will appear above the timestamp element.

If you need the timestamp element to appear at the very top, add it to the header as the final process

After you build the signature you can add this line:

timestamp.prependToHeader(secHeader);

it will put the timestamp element above your BinarySecurityToken element.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!