我需要从使用message-properties-transformer的骡子中的soap有效负载中读取wsse:Username(这是soap header的一部分)的内容。我想在其他地方使用这个变量。
Soap Webservice请求:
<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>
请让我知道我们是否可以在骡子中实现这一点?
- 在Mule的命名空间管理器中声明"soapenv"one_answers"wsse"命名空间:http://www.mulesoft.org/documentation/display/current/XML+Namespaces
- 在MEL表达式中使用XPath来提取所需的值:http://www.mulesoft.org/documentation/display/current/MEL+Cheat+Sheet#MELCheatSheet-XPathSupport
也使用set-variable
, set-session-variable
或set-property
代替旧的message-properties-transformer
。