【发布时间】:2012-03-30 21:26:27
【问题描述】:
在我的项目中,我使用 Spring Web Services (2.0.4.RELEASE) 创建了一个 webservice 客户端。
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 上运行
【问题讨论】:
-
这很奇怪。我会调试 hasFault 方法,看看发生了什么。