无法使用 xPath 和名称空间在 SOAPUI 属性 传输中提取值

Can not extract value in SOAPUI property transfer using xPath and namespaces

我尝试从 xml 中提取值 属性 Transfer 我使用 xPath:

declare namespace S="http://www.w3.org/2003/05/soap-envelope"
declare namespace ns7="http://schemas.BIGBANK.pl/" xmlns="http://schemas.BIGBANK.pl/"

/S:Envelope/S:Body/ns7:Document/ns7:QueryIPR/ns7:IPIList/ns7:PI/ns7:PI/ns7:cId/

我得到错误:

cId [net.sf.saxon.trans.XPathException: Required item type of first operand of '/' is node(); supplied value has item type xs:string]

我将传输源设置为上一步(即return有效XML),属性响应和路径语言XPath

不知道如何在 SoapUI 中修复它(在纯 java 中要容易得多)

好吧,我错了 在第二行我有:

declare namespace ns7="http://schemas.BIGBANK.pl/" xmlns="http://schemas.BIGBANK.pl/"

如果您使用纯 XML,则可以设置属性。但在 SoapUI 中它应该是:

declare namespace ns7="http://schemas.BIGBANK.pl/" 

现在它工作正常。