我正在 WSO2 ESB 中开发代理服务。
使用此配置,我检索 xml Web 服务响应。响应使用默认命名空间,如下所示:
<enrich>
<source type="body" clone="true" />
<target type="property" property="soapXmlResponseReadCahceDataService" />
</enrich>
这是 xml 响应:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body>
<cacheServices **xmlns="http://cache.services"**>
<cacheService>
<id>1</id>
<xmlrequesthash>b1e97b67-1226-4b1d-9081-b2a140690efd</xmlrequesthash>
<xmlrequestpayload>c</xmlrequestpayload>
<xmlresponsepayload>d</xmlresponsepayload>
<quantity>1</quantity>
</cacheService>
</cacheServices>
</soapenv:Body> </soapenv:Envelope>
此后我需要获取元素数量:
<property xmlns="http://cache.services" name="count" expression="//cacheServices/cacheService/quantity" />
WSO2 ESB 不允许您放置没有前缀的命名空间,而且我无法获得该值。我可以获取这个值,因为 xml 响应没有命名空间前缀?