我有一个 WSO2 流处理器应用程序,它发出一个 http-resquest 并接收一个 http-response:
@sink(type='http-request', sink.id='sinkid', publisher.url='http://xxx.xx.xxx.xxx', @map(type='xml', @payload('{{payloadBody}}')))
define stream SomeStream (payloadBody String, method string, headers string);
@source(type='http-response', sink.id='sinkid', http.status.code='200',
@map(type='xml', @attributes(parval='parval')))
define stream responseSomeStream(parval string);
如何将任何数据提取到控制台?我尝试了几种方法,但都没有奏效。
发送有效负载后我在控制台上得到的是:
{org.wso2.extension.siddhi.map.xml.sourcemapper.XmlSourceMapper} - Xpath: 'parval did not yield any results. Hence dropping the event : <resp action="read" units="S" user="TheUser" password="xxxxxxx" error="0"><val nodetype="16" node="2" display="u09 S5 Temp." name="u09 S5 Temp." stat="Online" statcode="2" error="0" pending="false" parval="-26.0" units="degc" units_index="4"> -26.0°C</val></resp> (Encoded)
我想从这个 XML 响应中提取一些参数,例如 statcode、parval 或单位。