您好,我收到以下消息:
<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>
我想使用 XPath<wsse:Username>admin</wsse:Username>
从传入消息中获取用户名
有什么建议吗?
编辑:
我试过这个:
<inSequence xmlns="http://ws.apache.org/ns/synapse">
<property xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" name="p1" expression="$header/wsse:Username" scope="default" />
<log>
<property name="output*********" expression="get-property('p1')" />
</log>
</inSequence>
但它不输出用户名:
MessageID: urn:uuid:68f95493-7dfd-416a-b
455-f77f4fd5c9c5, Direction: request, output********* =