SOAPUI - xpath 引擎/解析器似乎算术运算在那里不起作用
我有以下问题。
我正在发送 SOAP 请求,在获得响应后,我需要从中“获取数据”,添加“1”并作为另一个 SOAP 请求发回。
我对分析的 SOAP 响应是这样的:
<multiRef id="id0" soapenc:root="0" >
<name xsi:type="soapenc:string">basketId</name>
<value xsi:type="soapenc:string">12</value>
</multiRef>
我想获取 12 并向其添加 1:我通过插入新请求中的 XPATH 在 SOAP UI 中执行此操作(我不想使用其他任何内容)。新请求的纯 XML 看起来像这样:
<multiRef id="id1" soapenc:root="0" >
<name xsi:type="soapenc:string">basketId</name>
<value xsi:type="soapenc:string">${GetBasketID_3#Response#//multiRef[name="newBasketId"]/value/text() +1 }</value>
</multiRef>
xpath 表达式是:
//multiRef[name="newBasketId"]/value/text() + 1
使用 Firefox 中的 xpathchecker 可以正常工作,但 SOAP UI 会在那里发送空值。 如何使推送 SOAP UI xpath 解析器工作或以工作方式编写 xpath 表达式?
I have following problem.
I am sending SOAP request and after getting response I need to "Get Data" from it, add "1" and send back as another SOAP request.
My SOAP response to analyze is like that:
<multiRef id="id0" soapenc:root="0" >
<name xsi:type="soapenc:string">basketId</name>
<value xsi:type="soapenc:string">12</value>
</multiRef>
I want to get that 12 and add 1 to it: I do it in SOAP UI by XPATH inserted in new request (I do not want to use anything else). Pure XML of new request looks like that:
<multiRef id="id1" soapenc:root="0" >
<name xsi:type="soapenc:string">basketId</name>
<value xsi:type="soapenc:string">${GetBasketID_3#Response#//multiRef[name="newBasketId"]/value/text() +1 }</value>
</multiRef>
the xpath expression is:
//multiRef[name="newBasketId"]/value/text() + 1
With xpathchecker in Firefox this works, but SOAP UI sends empty value there.
How can I make push SOAP UI xpath parser to work or write xpath expression in working way?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您提供完整的 XML,将更容易提供准确的答案。不过你可以尝试下面的 xpath。该问题可能与缺少名称空间有关。
If you provide the entire XML, it will be easier to provide the exact answer. However you can try the below xpath. The problem can be related with the missing namespace .