2013-12-16 52 views
0

我需要在我的soap消息中籤署WS-Addressing元素。用apache axis2 ws-addresing和rampart可以嗎?使用Apache Axis2和Rampart簽署包括元素ReplyTo,To,MessageId和Action的所有頭文件

我找到了這個例子 - sample2 http://axis.apache.org/axis2/java/rampart/samples.html。但是ws-addressing元素沒有簽名。

編輯!

這是我的政策文件中的定義。這是行不通的!

<wsp:Policy wsu:Id="DefaultEndpoint_Echo_output_policy"> 
<wsp:ExactlyOne> 
    <wsp:All> 
    <sp:SignedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"> 
     <sp:Body/> 
     <sp:Header Name="To" Namespace="http://schemas.xmlsoap.org/ws/2004/08/addressing"/> 
     <sp:Header Name="From" Namespace="http://schemas.xmlsoap.org/ws/2004/08/addressing"/> 
     <sp:Header Name="FaultTo" Namespace="http://schemas.xmlsoap.org/ws/2004/08/addressing"/> 
     <sp:Header Name="ReplyTo" Namespace="http://schemas.xmlsoap.org/ws/2004/08/addressing"/> 
     <sp:Header Name="MessageID" Namespace="http://schemas.xmlsoap.org/ws/2004/08/addressing"/> 
     <sp:Header Name="RelatesTo" Namespace="http://schemas.xmlsoap.org/ws/2004/08/addressing"/> 
     <sp:Header Name="Action" Namespace="http://schemas.xmlsoap.org/ws/2004/08/addressing"/> 
    </sp:SignedParts> 
    </wsp:All> 
</wsp:ExactlyOne> 

回答

0

我已經從和SignedParts標籤

所以我的策略定義是這樣的刪除所有子標籤解決了這個問題。

<wsp:ExactlyOne> 
    <wsp:All> 
    <sp:SignedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy</sp:SignedParts> 
    </wsp:All> 
</wsp:ExactlyOne> 

我,只要你不定義任何簽名標籤和您只包括空標籤和SignedParts它會自動登錄所有的標題和正文發現。

相關問題