在spring集成中定制soap故障消息

在spring集成中定制soap故障消息,soap,spring-integration,Soap,Spring Integration,我目前正在学习spring集成。我想从错误消息创建一个soap响应。如果发生任何错误,spring会在消息体中给出错误响应。我想自定义它。我需要显示一个包含痛苦响应对象的响应对象,而不是显示它。例如: 如果soap错误消息是这样的 <SOAP-ENV:Fault> <faultcode xsi:type="xsd:string">SOAP-ENV:Client</faultcode> <faultstring xsi:type=

我目前正在学习spring集成。我想从错误消息创建一个soap响应。如果发生任何错误,spring会在消息体中给出错误响应。我想自定义它。我需要显示一个包含痛苦响应对象的响应对象,而不是显示它。例如: 如果soap错误消息是这样的

  <SOAP-ENV:Fault>
     <faultcode xsi:type="xsd:string">SOAP-ENV:Client</faultcode>

     <faultstring xsi:type="xsd:string">
        Failed to locate method (ValidateCreditCard) in class (examplesCreditCard) at /usr/local/ActivePerl-5.6/lib/site_perl/5.6.0/SOAP/Lite.pm line 1555.
     </faultstring>

  </SOAP-ENV:Fault>


SOAP-ENV:客户端
在/usr/local/ActivePerl-5.6/lib/site_perl/5.6.0/SOAP/Lite.pm第1555行的类(examplesCreditCard)中定位方法(ValidateCreditCard)失败。

取而代之的是,我需要展示它的反应,如下所示

 <m:myResponse xmlns:m ="http://www.example.org/myschema">
     <m:error> Failed to locate method (ValidateCreditCard) in class (examplesCreditCard) at /usr/local/ActivePerl-5.6/lib/site_perl/5.6.0/SOAP/Lite.pm line 1555</m:error>
</m:myResponse>


在/usr/local/ActivePerl-5.6/lib/site_perl/5.6.0/SOAP/Lite.pm第1555行的类(examplesCreditCard)中定位方法(ValidateCreditCard)失败

具有
错误通道
选项,可以使用一些错误处理流处理任何下游异常,并从中返回所需结果。该结果被用作SOAP响应


希望我说得清楚。

嘿,阿尔泰,谢谢你的回复。只是想检查一下是不是?我需要根据请求的负载创建响应,我们可以将请求的有效负载与异常一起发送到错误通道吗?实际上,框架通过
MessagineException
上的
failedMessage
错误通道上的
ErrorMesstage
为您执行此操作。虽然那条失败的消息将是最后一条有罪的消息。因此,要访问原始请求
有效负载
,必须使用带有自定义标题的
来丰富要处理的消息:
。并且此标头将在该
失败消息中可用。