【问题标题】:Spring Webservice Client: Cannot handle SOAP faultsSpring Webservice 客户端:无法处理 SOAP 错误
【发布时间】: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 方法,看看发生了什么。

标签: java spring spring-ws


【解决方案1】:

问题不在于 Spring Web 服务。这是我们的网络服务返回无效响应。 :-/

我从这个问题中学到了什么:

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-11-13
    • 1970-01-01
    • 1970-01-01
    • 2015-08-27
    • 1970-01-01
    • 1970-01-01
    • 2015-07-08
    相关资源
    最近更新 更多