0
votes

I am trying to solve following problem:
I have a system with which communication is done through SOAP (XML over http).
In Jmeter I am using SOA/XML-RPC (not wsdl based webservice).
I am sending one SOAP request and receiving response in vollowing tag

<Prodrevision>5</Prodrevision>

This number changes from time to time and goal is to get that number in that tag put it as user defined variable and pass it to another SOAP/XML-RPC

Mine jmeter test plan looks like that


-User defined variabla - here I have empty varaibla named "var'

-SOAP/XML- RPC (this SOAP REQUEST causes that RESPONSE is received)
- XPath Extractor with

          reference name: var
          XPath Query: //*[local-name()='Prodrevision']/text()

(this should according to FAQ's process/parse response and asssign it to variable var)

-SOAP/XML-RPC - and in this XML request SOAP/XML-RPC data field has

..xml data
<Prodrevision>${var}</Prodrevision>
...xml data

But I am not sending anything in the second request ??? mine requests hits server but there is no value. Where I made a mistake?

2

2 Answers

1
votes

Whenever you see ${variableName} in the request, it means the variable hasn't been defined. Most likely, it's an issue with how XPath is setup. I've never used that component, so unfortunately I can't help you there.

However, I've found the post processor Regular Expression Extractor to be very easy and accurate.

The structure would like this:

1st Soap Request
  -- regular expression stored to "var"
 2nd Soap Request, using ${var}
0
votes

The problem has been partially solved. There was an issue in a wrong or badly, for JMeter, defined XPath query

      reference name: var
      XPath Query://name[contains(text(),'Prodrevision')]/parent::multiRef/value

After the XPath query I have added beanshell postprocessor with following code

      print("Beanshell processing  SOAP response");
      print("var" +${var} );

So finally I see what value is being grabbed by the XPath extractor.

I have also installed xpather 1.4.5 as a Firefox add-on. And opened XML response and tuned a bit XPath query to have a proper answer. Then this was copied to JMeter and worked.

Next, in SOAP request that had to be sent by JMeter, I have put my XPath extractor value in the following way:

<name xsi:type="soapenc:string">Prodrevision</name>
<value xsi:type="soapenc:string">${var}</value>

and this again worked well for one thread.

Problem at this moment is with threads. If there is more than 1 (one) thread, it is generating wrong requests :-(