12
我對我的soap服務使用SpringWS並像這樣驗證它;Spring WS:如何獲取並保存XSD驗證錯誤
<sws:interceptors>
<bean id="payloadValidatingInterceptor" class="org.springframework.ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptor">
<property name="schema" value="/schemas/my.xsd"/>
<property name="validateRequest" value="false"/>
<property name="validateResponse" value="true"/>
</bean>
@PayloadRoot(namespace = NAMESPACE, localPart = "ServiceProvider")
@ResponsePayload
public ServiceProviderTxn getAccountDetails(@RequestPayload ServiceProviderrequest)
{ ...}
這工作得很好,但是當有一個錯誤是它到達終點之前,返回彈簧產生錯誤響應,所以我再也沒有機會對其進行處理。但我希望能夠日誌並將完整的錯誤消息保存到數據庫。我發現的一個方法是在我的另一個問題中做這樣的事情;
Spring WS How to get all error messages when validation fails
但我想這是行不通的。
tnx但你能擴展你的答案與代碼並結合我在我的鏈接上描述的答案嗎?它更像是理論而不是工作解決方案 – Spring
@Spring:添加樣本類 – Giovanni
我試過但handleRequestValidationErrors永遠不會調用 – Spring