[英]How to use enrich mediator to add header part in wso2 esb
This is existing header 这是现有的标头
<s:Header>
<ActivityId xmlns="http://schemas.microsoft.com/2004/09/ServiceModel/Diagnostics" CorrelationId="10018d27-2573-4d6b-8bcb-b49f6c686f1a">5d827c1d-bd7b-437f-904f-5f82c9844022</ActivityId>
</s:Header>
I need to add following security in header part using enrich mediator 我需要使用Rich Mediator在标头部分添加以下安全性
<o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<o:UsernameToken u:Id="uuid-05a278f7-0f00-4710-b81c-4401fd280d6d-3">
<o:Username>FISEPAY_DEV</o:Username>
<o:Password>RaDrup5E4awreP</o:Password>
</o:UsernameToken>
</o:Security>
So how i need to add using enrich mediator 所以我需要如何使用Rich Mediator添加
Try using the below code. 尝试使用以下代码。
<enrich>
<source type="inline" clone="true">
<o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<o:UsernameToken u:Id="uuid-05a278f7-0f00-4710-b81c-4401fd280d6d-3">
<o:Username>FISEPAY_DEV</o:Username>
<o:Password>RaDrup5E4awreP</o:Password>
</o:UsernameToken>
</o:Security>
</source>
<target xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
xpath="//<s:Header>"/>
</enrich>
<log level="full"/>
Use the property mediator as below , 使用属性中介器,如下所示,
<property name="test" expression="get-property('registry','conf:/test.xml')" scope="default" type="OM" />
conf:/test.xml should be the path where your xml is stored.
Now this variable "test" can be used in enrich mediator. 现在,此变量“测试”可以在富媒体中使用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.