私はWebサービスをホストしています。クライアントが不正な形式のXMLを送信した場合に備えて、シナリオを処理したかった
これが私が作成したハンドラーです
public boolean handleMessage(SOAPMessageContext smc)
{
Boolean outboundProperty =
(Boolean)smc.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
SOAPMessage message = null;
try
{
// This handling iss required in case a mal-formed XML is sent.
message = smc.getMessage();
}
catch(Throwable t )
{
// I want to log the XML in the database
// But the problem is I don't know how to get the XML
// as message is null.
}
}
送信されたXMLに関する情報がないcatch(Throwable t)ブロックに到達します。エラーログテーブルにログインできるのは、不正な形式のXMLがクライアントから送信されたということだけです。
実際の要件:
追跡目的で不正な形式のXMLをログに記録して保存します。