問題
デフォルトでは、JAX-WS は、キャッチされない拡張例外がRuntimeException
サーバーで発生すると、次の SOAP 障害メッセージを作成します。
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<S:Fault xmlns:ns3="http://www.w3.org/2003/05/soap-envelope">
<faultcode>S:Server</faultcode>
<faultstring>[runtime exception message here]</faultstring>
<detail>
<ns2:exception class="java.lang.RuntimeException" note="To disable this feature, set com.sun.xml.ws.fault.SOAPFaultBuilder.disableCaptureStackTrace system property to false" xmlns:ns2="http://jax-ws.dev.java.net/">
<message>[runtime exception message here too]</message>
<ns2:stackTrace>
[stack trace details]
</ns2:stackTrace>
</ns2:exception>
</detail>
</S:Fault>
</S:Body>
</S:Envelope>
代わりにそれを送信するためにその動作を変更したいことを除いて、どのような意味がありますか:
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<S:Fault xmlns:ns3="http://www.w3.org/2003/05/soap-envelope">
<faultcode>S:Server</faultcode>
<faultstring>Something wrong happened and it's totally our fault</faultstring>
</S:Fault>
</S:Body>
</S:Envelope>
このメッセージは、 RuntimeExceptionのメッセージ コンテンツではなく、サーバー側で発生する可能性のある拡張例外のカスタム静的メッセージであることに注意してください。RuntimeException
WSDL を変更できず、カスタム例外を設定したくありません。
私は春のプラグインを使用しています:com.sun.xml.ws.transport.http.servlet.WSSpringServlet
どうやってやるの?