2012-03-14 73 views
0

在我的項目中,我使用Spring Web Services(2.0.4.RELEASE)創建了一個webservice客戶端。Spring Webservice客戶端:無法處理SOAP錯誤

的webServiceTemplate在我的Spring配置定義:

<bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller"> 
<bean id="wsClient" class="org.springframework.ws.client.core.WebServiceTemplate"> 
    <property name="marshaller" ref="marshaller" /> 
    <property name="unmarshaller" ref="marshaller" /> 
</bean> 

當我調用服務(wsClient.marshalSendAndReceive(...)),它返回一個SOAP錯誤的Web服務客戶端不承認它。 它試圖編組並引發ValidationException。

我看了一下Spring Web Service的源代碼。在WebServiceTemplate類中存在一個方法protected boolean hasFault(WebServiceConnection connection, WebServiceMessage response)。但是這個方法總是返回false。

我已經選中了這個問題:Java Spring Web Service Client Fault Handling

服務發送一個HTTP狀態代碼500響應所以這是沒有問題的。

有沒有人有一個想法如何解決這個問題?

謝謝!

編輯:應用程序在Weblogic 10.3.5

+0

這很奇怪。我會調試hasFault方法,看看發生了什麼。 – jddsantaella 2012-03-14 18:24:10

回答

0

問題運行沒有Spring的web服務。這是我們的web服務返回無效的響應。 : -/

我從這個問題了解到: