开发者

SOAPUI - xpath engine/parser seems that arthmetic operations do not works there

开发者 https://www.devze.com 2023-02-19 17:49 出处:网络
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.

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?


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 .

${Test Request#Response#declare namespace ns1='http://ADDNAMESPACEHERE'; //multiRef[1]/value[1]/text()}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号