Spring integration 使用spring消息解析器获取soap错误内容
我正在使用spring集成和SOAP集成外部系统。我将Spring integration 使用spring消息解析器获取soap错误内容,spring-integration,spring-ws,Spring Integration,Spring Ws,我正在使用spring集成和SOAP集成外部系统。我将SoapFaultMessageResolver添加到 <int-ws:outbound-gateway id="mnpOutboundGateway" request-channel="mnpWSRequestChannel" reply-channel="mnpWSResponseChannel"
SoapFaultMessageResolver
添加到
<int-ws:outbound-gateway id="mnpOutboundGateway"
request-channel="mnpWSRequestChannel"
reply-channel="mnpWSResponseChannel"
marshaller="mnpMarshaller"
unmarshaller="mnpMarshaller"
destination-provider="mnpUriProvider"
fault-message-resolver="mnpFaultResolver"
message-factory="mnpMessageFactory"/>
<bean name="mnpFaultResolver" class="com.iquest.play.integration.mnp.MnpSoapFaultResolver">
现在我已经覆盖了
@凌驾
public void resolveFault(WebServiceMessage消息)引发IOException{…
问题是,如何获取Soap消息内容(原因、错误代码)?尝试从现有解决方案的来源开始
SoapFaultMessageResolver
:
SoapMessage soapMessage = (SoapMessage) message;
throw new SoapFaultClientException(soapMessage);
此外,SoapFaultClientException的源代码(某些部分):
SoapBody body = faultMessage.getSoapBody();
soapFault = body != null ? body.getFault() : null;
...
public QName getFaultCode() {
return soapFault != null ? soapFault.getFaultCode() : null;
}
...
public String getFaultStringOrReason() {
return soapFault != null ? soapFault.getFaultStringOrReason() : null;
}
我认为从问题的角度来看已经足够了。我正试图从
webservicesessage
中获得它。非常感谢您的帮助,已经是第二次了:)