【问题标题】:wso2esb enrich mediator deletes node soap:Headerwso2esb丰富中介删除节点soap:Header
【发布时间】:2014-08-14 15:03:15
【问题描述】:

我在 soap:Header 中有 2 个孩子 wsse:Security 并试图删除一个。我尝试使用 Enrich Mediator 执行此操作,但不是替换 soap:Header 它删除。这是重现它的简单示例:

<inSequence>
     <enrich>
        <source type="inline" clone="true">
           <soapenv:Header xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
              <foo/>
           </soapenv:Header>
        </source>
        <target xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                xpath="//soapenv:Header"/>
     </enrich>
     <log level="full"/>
  </inSequence>

日志中介记录不带标题的消息。如果我添加到 target action="child",一切都会按预期工作。所以我有两个问题: 1. 为什么丰富的调解员会那样做? 2.如何用其他方式更改标题?

【问题讨论】:

    标签: soap wso2esb


    【解决方案1】:

    您应该使用 header 中介来更改 SOAP 标头

    看看那里:https://docs.wso2.com/display/ESB481/Header+Mediator

    添加自定义标题的示例:

    <header xmlns:myns="http://com/header" name="myns:MyHeader" value="0"/>
    

    删除它的示例:

    <header xmlns:myns="http://com/header" name="myns:MyHeader" action="remove"/>
    

    您可以使用此中介来更改 http 标头:只需添加一个值等于“传输”的范围属性

    【讨论】:

    • 删除两个 wsse:Security
    • 虽然,我可以将需要的部分保存在属性中...谢谢,它可以工作。但我仍然不明白为什么丰富的调解员会那样做。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-10-31
    • 1970-01-01
    • 2015-07-17
    • 1970-01-01
    • 2018-11-18
    • 2011-07-27
    相关资源
    最近更新 更多