【问题标题】:return soap message with error on faults返回带有错误错误的肥皂消息
【发布时间】:2013-11-08 13:24:55
【问题描述】:

客户不想得到错误的肥皂消息并且喜欢像这样的东西

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
   <SOAP-ENV:Header/>
   <SOAP-ENV:Body>
      <ns2:TestResponse xmlns:ns2="http://teclot.com/exchange">
         <ns2:return>ERROR</ns2:return>
      </ns2:TestResponse>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

我们在项目中使用 Spring Integration。我认为它应该看起来像

    <int-ws:inbound-gateway id="wsInboundGateway"
                            request-channel="inboundChannel"
                            marshaller="serverSchemaMarshaller"
                            unmarshaller="serverSchemaMarshaller"
                            error-channel="errorChannel" />

     <bean id="errorWrapper" class="pro.tender.customer.ws2apmq.ErrorWrapper"/>

    <int:transformer id="errorWrap" input-channel="errorChannel" ref="errorWrapper" output-channel="inboundChannel" />

我的错误在哪里?

` 

【问题讨论】:

  • 提供更多关于您想要实现的目标的背景信息。
  • 听起来你的客户需要明白他们必须处理在你的托管代码之外发生的soap错误(服务器错误,客户端错误),所以处理逻辑抛出应该不是什么大问题代码中的肥皂错误。

标签: java web-services spring-integration


【解决方案1】:

首先:你的ErrorWrapper是什么?请显示它的代码。至少他对ErrorMessage 做了什么以及他返回了什么? 但是您的问题在这里output-channel="inboundChannel"。 删除此属性,如果您的 ErrorWrapper 没有返回 Message&lt;?&gt;,您将获得预期的结果。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多