读取有效载荷中的肥皂标题元素 [英] reading soap header element in payload

查看:104
本文介绍了读取有效载荷中的肥皂标题元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用message-properties-transformer从m子中的以下soap有效负载读取wsse:Username(属于soap标头的一部分)的内容. 我想在其他地方使用此变量.

I need to read contents of wsse:Username(which is part of soap header) from following soap payload in mule using message-properties-transformer. I would like to use this variable somewhere else.

Soap Web服务请求:

Soap Webservice request:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:spel="http://mobistar.be/spellchecker/">
   <soapenv:Header> 
      <wsse:Security soapenv:mustUnderstand="1" >
         <wsse:UsernameToken wsu:Id="UsernameToken-1">
           <wsse:Username>Tester01</wsse:Username>
         </wsse:UsernameToken>
       </wsse:Security>
   </soapenv:Header> 
   <soapenv:Body>
     <spel:CheckSpellingRequest>
        <spel:Text>Please test this blabla</spel:Text>
      </spel:CheckSpellingRequest>
   </soapenv:Body>
</soapenv:Envelope>

请让我知道我们是否可以在m子中实现这一目标?

Please let me know if we can achieve this in mule?

推荐答案

  • 在Mule的命名空间管理器中声明"soapenv"和"wsse"命名空间: http ://www.mulesoft.org/documentation/display/current/XML+Namespaces
  • 在MEL表达式中使用XPath提取所需的值: http://www.mulesoft.org/documentation/display/current/MEL+Cheat+Sheet#MELCheatSheet-XPathSupport
    • Declare the "soapenv" and "wsse" namespaces in Mule's namespace manager: http://www.mulesoft.org/documentation/display/current/XML+Namespaces
    • Use XPath in a MEL expression to extract the value(s) you need: http://www.mulesoft.org/documentation/display/current/MEL+Cheat+Sheet#MELCheatSheet-XPathSupport
    • 也可以使用set-variableset-session-variableset-property代替原来的message-properties-transformer.

      Also use set-variable, set-session-variable or set-property instead of the old message-properties-transformer.

      这篇关于读取有效载荷中的肥皂标题元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆