Xpath 如何使SoapUI测试用例中的属性转移正常工作?

Xpath 如何使SoapUI测试用例中的属性转移正常工作?,xpath,soapui,Xpath,Soapui,我试图使用SoapUI的transfer属性TestStep将值从一个WS调用的响应传输到另一个WS调用的请求 第一个WS响应: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xml

我试图使用SoapUI的transfer属性TestStep将值从一个WS调用的响应传输到另一个WS调用的请求

第一个WS响应:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <soapenv:Header/>
  <soapenv:Body>
    <ns5:PSResponse xmlns:ns5="http://www.ab.com/abonline/service/PaymentService/1.0/" xmlns:ns6="http://www.ab.com/abonline/service/CustomerCard/1.0/" xmlns:ns7="https://secure.incab.se/DTServerModuleService/v1">
      <ns5:abTransactionReference>1085-0</ns5:abTransactionReference>
      <ns5:status>0</ns5:status>
    </ns5:PSResponse>
  </soapenv:Body>
</soapenv:Envelope>
我尝试使用:
//abTransactionReference

给我:
[目标XPath[/abTransactionReference]缺少匹配项]

我还尝试了完整的xpath:
declare namespace soapenv=”http://schemas.xmlsoap.org/soap/envelope/"
//soapenv:Envelope/soapenv:Body/UpdatePaymentRequest/abTransactionReference


…导致类似错误。

似乎应该将默认名称空间设置为
http://www.ab.com/...
同样

您不能将
用于命名空间定义。例如,在上述情况下>>

declare namespace soapenv="http://schemas.xmlsoap.org/soap/envelope/"
应该是

declare namespace soapenv='http://schemas.xmlsoap.org/soap/envelope/';

尝试向UpdatePaymentRequest请求消息添加XPath断言。单击“XPath匹配配置”对话框上的“声明”按钮,您将看到soapUI对“”命名空间使用的前缀。我想会是这样的:

declare namespace soapenv='http://schemas.xmlsoap.org/soap/envelope/';
declare namespace ns1='http://www.ab.com/abonline/service/PaymentService/1.0/';
(见附件)。然后就不需要XPath断言了——您可以删除它。因此,在xpath中使用“ns1”前缀。最后,您将拥有以下xpath:

declare namespace soapenv='http://schemas.xmlsoap.org/soap/envelope/';
declare namespace ns1='http://www.ab.com/abonline/service/PaymentService/1.0/';
/soapenv:Envelope/soapenv:Body/ns1:UpdatePaymentRequest/ns1:abTransactionReference

只有链接的答案不是这样的。请详细说明你的答案。
declare namespace soapenv='http://schemas.xmlsoap.org/soap/envelope/';
declare namespace ns1='http://www.ab.com/abonline/service/PaymentService/1.0/';
/soapenv:Envelope/soapenv:Body/ns1:UpdatePaymentRequest/ns1:abTransactionReference