首页 > 解决方案 > 如何获取 XML 有效负载属性

问题描述

我有一个有效载荷如下。

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
        <soapenv:Body>
            <response xmlns="http://edip-api.macausjm-glp.com/apiservice">
                <recipientAddress>zoehuang@asqimacau.com,well168168@gmail.com</recipientAddress>
                <subject>Test email</subject>
                <content>
                    <html>
                        <h1>this is the title</h1>
                        <br />
                        <p>this is the content................</p>
                    </html>
                </content>
            </response>
        </soapenv:Body>
    </soapenv:Envelope> {org.apache.synapse.mediators.builtin.LogMediator}

我需要获取如下内容值,如何获取属性?

 <html>
     <h1>this is the title</h1>
     <br />
     <p>this is the content................</p>
 </html>

标签: wso2ei

解决方案


要将 XML 树存储在属性中,请使用 type='OM'

所以<property name="testAmanda" expression="//html" type="OM" />


推荐阅读