サーバー内部エラーの場合のaxis2+rampartWS-Security応答に問題があります。サーバーが「200OK」を返すと、すべて問題ないようです。応答は、適切なタイムスタンプ、署名があり、関数応答XMLを復号化するかどうかをrampartによってチェックされます。しかし、サーバーが「500 Internal Server Error」を返すと、axis2/rapartは例外をスローします。
ERROR Thread-11 org.apache.axis2.engine.AxisEngine - Must Understand check failed for header
答えに何か問題があると思い、soapUIでテストしました。保護された形式と復号化された形式の両方で同様の応答があります。これらの応答は、HTTPステータス、エラーを示すXML応答コード、およびSOAPタグの大文字と小文字のみが異なります。良い反応の場合は
<SOAP-ENV:Envelope ...
エラーの場合:
<soap:Envelope ...
を含む構造の残りの部分はmustUnderstand="1"
同じです。
axis2.xml
私は構成し、順序と同じになるように構成InFlow
しInFaultFlow
ました:
<phase name="Addressing">...</phase>
<phase name="Security"/>
<phase name="PreDispatch"/>
クライアントのトレースを有効にしました。応答が良ければ、次のように表示されます。
DEBUG Thread-11 org.apache.rampart.RampartEngine - Enter process(MessageContext msgCtx)
DEBUG Thread-11 org.apache.axis2.engine.Phase - [MessageContext: logID=urn:uuid:UUID] Invoking Handler 'SecurityInHandler' in Phase 'Security'
...there is decrypted message
DEBUG Thread-11 org.apache.rampart.handler.WSDoAllReceiver - WSDoAllReceiver: exit invoke()
DEBUG Thread-11 org.apache.axis2.engine.Phase - [MessageContext: logID=urn:uuid:UUID] Checking post-conditions for phase "Security"
DEBUG Thread-11 org.apache.axis2.engine.Phase - [MessageContext: logID=urn:uuid:UUID] Checking pre-condition for Phase "PreDispatch"
...
エラーの場合、そのようなトレースはありません。
DEBUG Thread-11 org.apache.rampart.RampartEngine - Enter process(MessageContext msgCtx)
DEBUG Thread-11 org.apache.axis2.engine.Phase - [MessageContext: logID=urn:uuid:UUID] Checking post-conditions for phase "Security"
DEBUG Thread-11 org.apache.axis2.engine.Phase - [MessageContext: logID=urn:uuid:UUID] Checking pre-condition for Phase "PreDispatch"
...
DEBUG Thread-11 org.apache.axis2.engine.Phase - [MessageContext: logID=urn:uuid:UUID] Checking post-conditions for phase "soapmonitorPhase"
DEBUG Thread-11 org.apache.axis2.engine.AxisEngine - MustUnderstand header not processed or registered as understood{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Security
DEBUG Thread-11 org.apache.axis2.i18n.ProjectResourceBundle - org.apache.axis2.i18n.resource::handleGetObject(mustunderstandfailed)
ERROR Thread-11 org.apache.axis2.engine.AxisEngine - Must Understand check failed for header http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd : Security
org.apache.axis2.AxisFault: Must Understand check failed for header http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd : Security
at org.apache.axis2.engine.AxisEngine.checkMustUnderstand(AxisEngine.java:97)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:163)
at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:364)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:417)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
SecurityInHandler
呼び出しはありません。
「200OK」ステータスの場合やsoapUIの場合と同じように、復号化されたメッセージを表示したいのですが。私の構成の何が問題になっていますか?
編集
「500内部サーバーエラー」の場合にのみ、このようなエラーが発生することを確認しました。サーバーが「200OK」と同じ暗号化されたコンテンツで応答した場合、axis2はそれを復号化できます!