SOAP中介Wso2 ESB

SOAP中介Wso2 ESB,soap,xpath,wso2,wso2esb,orchestration,Soap,Xpath,Wso2,Wso2esb,Orchestration,你好,我有以下消息: <soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"> <soapenv:Header> <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" soapen

你好,我有以下消息:

 <soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
      <soapenv:Header>
         <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" soapenv:mustUnderstand="true">
            <wsu:Timestamp xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="Timestamp-11">
               <wsu:Created>2012-09-06T09:59:04.031Z</wsu:Created>
               <wsu:Expires>2012-09-06T10:04:04.031Z</wsu:Expires>
            </wsu:Timestamp>
            <wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="UsernameToken-12">
               <wsse:Username>admin</wsse:Username>
               <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">admin</wsse:Password>
            </wsse:UsernameToken>
         </wsse:Security>
      </soapenv:Header>
      <soapenv:Body />
   </soapenv:Envelope>
努维奥

您可以使用表达式“$header/wsse:Security”,其中“wsse”作为Security header元素携带的名称空间的前缀。下面显示了如何将其保存到Synapse消息上下文属性

<property xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" name="Security" expression="$header/wsse:Security" />

仅供参考,您可以使用语法“$header/header\u name”提取SOAP消息中存在的任何SOAP头元素

希望这有帮助

干杯,
Prabath

否则,您可以选择使用xpath://wsse:Username/text()“ 我想这会对你有所帮助。我也是这个
wso2
工具的新手


希望这能带给你..

所以在我的例子中应该是:$header/wsse:Username?在你的例子中应该是“$header/wsse:Security/wsse:UsernameToken/wsse:Username”。在检索xml节点的值时,这里要计算的是XPath语句。在您的例子中,它应该是“$header/wsse:Security/wsse:UsernameToken/wsse:Username”。这是一个XPath语句,在这里检索xml节点的值时对其进行计算
MessageID: urn:uuid:68f95493-7dfd-416a-b
455-f77f4fd5c9c5, Direction: request, output********* =
<property xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" name="Security" expression="$header/wsse:Security" />