在我的测试中,我必须从通道队列中选择几条消息之一。所以我有这样的步骤:
http()
.server(server_name)
.receive()
.post(eventService)
.selector("xpath://Envelope/Body/CreateMessageDrivenEventRequest/MessageHeader/CustomsData/TraderIdentifier=123456NA")
但是选择器不会从通道队列中选择需要的请求。任何人都可以分享正确 xpath 或其他类型选择器的示例吗?
谢谢,奥尔哈
评估请求:
<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" soapenv:mustUnderstand="1">
<wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="UsernameToken-24012100">
<wsse:Username>Username</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">password</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
<addr:To xmlns:addr="http://www.w3.org/2005/08/addressing">address</addr:To>
<addr:Action xmlns:addr="http://www.w3.org/2005/08/addressing">action</addr:Action>
<addr:ReplyTo xmlns:addr="http://www.w3.org/2005/08/addressing">
<addr:Address>http://www.w3.org/2005/08/addressing/anonymous</addr:Address>
</addr:ReplyTo>
<addr:MessageID xmlns:addr="http://www.w3.org/2005/08/addressing">uuid:b23a690e-15fc-4ffa-8a7f-dd981ebb92ba-1a</addr:MessageID>
</soapenv:Header>
<soapenv:Body>
<CreateMessageDrivenEventRequest xmlns="xxx">
<cct:MessageHeader xmlns:cct="yyy">
<cct:TransactionId>792974800</cct:TransactionId>
<cct:MessageId>18c9d974-3a1c-48ca-811f-a0787d9d2ee5</cct:MessageId>
<cd:CustomsData xmlns:cd="zzz">
<cd:TraderIdentifier>123456NA</cd:TraderIdentifier>
<cd:MailboxCollectId>NA123456NA</cd:MailboxCollectId>
<cd:MessageVersion>1</cd:MessageVersion>
<cd:DocumentFormat>xml</cd:DocumentFormat>
<cd:InputIndicator>DTI</cd:InputIndicator>
<cd:DateReceived>20161125141127</cd:DateReceived>
</cd:CustomsData>
</cct:MessageHeader>
<n:MRN xmlns:n="xxx">123456789</n:MRN>
<n:Event xmlns:n="xxxx">
<cct:Date xmlns:cct="xxxx">20170126160630</cct:Date>
<cct:User xmlns:cct="xxxx">System</cct:User>
<cct:Comments xmlns:cct="xxxx">Message sent to Trader (Carrier)</cct:Comments>
<cct:StateCode xmlns:cct="xxxx">I012</cct:StateCode>
<cct:EventCode xmlns:cct="xxxx">1234</cct:EventCode>
</n:Event>
</CreateMessageDrivenEventRequest>
</soapenv:Body>
</soapenv:Envelope>
`