在空字符串中
代码将卡号保存在请求中的卡号变量中。
<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>
卡号在日志中
@esha sherry,xpath3表达式获得卡号应为
#[xpath3('/soapenv:Envelope/soapenv:Body/typ:GetMemberProfileRequest/typ:CardNumber', message.payload, 'STRING')]