用于将卡号保存在卡号变量中的代码。
<set-variable variableName="cardNumber" value="#[xpath3('//@CardNumber', message.payload,'STRING')]" doc:name="Set cardNumber"/>
<logger level="INFO" message=" #[xpath3('//@CardNumber', message.payload, 'STRING')]" />
<logger message="#[flowVars['operationName']] cardNumber is = #[flowVars['cardNumberr']]" level="INFO" category="member" doc:name="Logger"/>
以下是有效负载
mlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://ws.loyalty.com/cpm/esb/amrp/2/1/member/types">
<soapenv:Header/>
<soapenv:Body>
<typ:GetMemberProfileRequest>
<typ:RequestContext Channel="WEB" Source="" Locale="" User="ONLINEUSER"/>
<typ:CardNumber>80000000021</typ:CardNumber>
</typ:GetMemberProfileRequest>
</soapenv:Body>
</soapenv:Envelope>
卡号在日志中显示空字符串
答案 0 :(得分:0)
@esha sherry,获取卡号的xpath3表达式应为
#[xpath3('/soapenv:Envelope/soapenv:Body/typ:GetMemberProfileRequest/typ:CardNumber', message.payload, 'STRING')]