Spring Webservice Client:无法处理SOAP错误

时间:2012-03-14 12:06:09

标签: java spring spring-ws

在我的项目中,我使用Spring Web Services(2.0.4.RELEASE)创建了一个Web服务客户端。

webServiceTemplate在我的spring config中定义:

<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错误时,webservice客户端无法识别它。 它试图对其进行编组并抛出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上运行

1 个答案:

答案 0 :(得分:0)

问题不在于Spring Web Services。我们的webservice返回了无效的响应。 : - /

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

相关问题