You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by masood ghasemzadeh <ma...@gmail.com> on 2012/12/01 10:26:22 UTC

Sending XML SOAP Request, binary file attached

Hi,

In JMeter, I want to send a XML SOAP request to a web-service (has its WSDL
address) which has a binary file in one of its elements. Any idea how can I
generate such XML request in JMeter?


-- 
Yours Faithfully,
Masood Ghasemzadeh

Re: Sending XML SOAP Request, binary file attached

Posted by sebb <se...@gmail.com>.
On 2 December 2012 03:50, Srinivas <ma...@gmail.com> wrote:
> On Sat, Dec 1, 2012 at 2:56 PM, masood ghasemzadeh <ma...@gmail.com>wrote:
>
>> how can I
>> generate such XML request in JMeter?
>>
>
> Hi Masood,
>
> please check out the below options,  i used to record with badboy n then
> export the same to jmeter most of the times
>
> Another approach to test web-application is use of automated recording
> tools like Badboy to record steps that you wanted to test with your web
> application. Then you can pass the same script to Jmeter for testing
> purpose.
>
> You can also pass different values to parameters within script to test
> different scenarios. For eg.Your application is having 'Login page' with
> username/password field. Then you can record the script in case of 1)valid
> and 2) invalid login credentials.
>
> Then during testing you can pass different values through CSV or by
> modifying some values directly in recorded script.
>
> you can insert dynamic or random data into the XML using __Random and
> __char functions nested in the XML.
>
> So that everytime an xml is posted, the values will be random.
>
> basically, just define your xml structure and use the __random and __char
> functions nested in each other to randomly create any random text/numbers.
> Then use the __time function to generate date/time data.
>
> you need to send an XML then some SOAP/XML-RPC sampler is to be used. In
> such a case, all you need is just put a template with params into
> SOAP-XML-RPC Data field. <soapenv:Envelope xmlns:soapenv="
> schemas.xmlsoap.org/soap/envelope/"><http://schemas.xmlsoap.org/soap/envelope/%22%3E>;
> <soapenv:Body> <ns2:SomeActionRequest xmlns:ns2="urn:some:namespace">
> <ns2:Param1>${paramFirst}</ns2:Param1> </ns2:SomeActionRequest>
> </soapenv:Body> </soapenv:Envelope> If you're limited with plain HTTP, then
> XML is to be sent as a get/post param, right? Then just add params to your
> HTTP Request sampler.
>
> JMeter guidelines strongly recommend to use pre-generated data to have good
> perfomance and accuracy.
>
> The task could be done via CSV Data Set Config component (Best
> Practices<http://jakarta.apache.org/jmeter/usermanual/best-practices.html>,
> section 16.5). The main idea is to generate a big test data set, save it to
> text file and then use as params in request template (line of CSV file per
> request). One can put whole request as one and only param if s/he wish.
>
> Please be noted that JMeter 2.3.4 (latest version atm) has some

The latest version of JMeter is actually 2.8:

http://jmeter.apache.org/download_jmeter.cgi

> restrictions:
>
>    - it doesn't understand multiline values (though such ones supported by
>    CSV standard itself), so escaping might be required;
>    - it doesn't understand column names, so it is possible to associate
>    variables by column position only (not by logical name unfortunately).

2.8 does understand column names.

> Thanks,
> --
> M. Srinivas

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


Re: Sending XML SOAP Request, binary file attached

Posted by Srinivas <ma...@gmail.com>.
On Sat, Dec 1, 2012 at 2:56 PM, masood ghasemzadeh <ma...@gmail.com>wrote:

> how can I
> generate such XML request in JMeter?
>

Hi Masood,

please check out the below options,  i used to record with badboy n then
export the same to jmeter most of the times

Another approach to test web-application is use of automated recording
tools like Badboy to record steps that you wanted to test with your web
application. Then you can pass the same script to Jmeter for testing
purpose.

You can also pass different values to parameters within script to test
different scenarios. For eg.Your application is having 'Login page' with
username/password field. Then you can record the script in case of 1)valid
and 2) invalid login credentials.

Then during testing you can pass different values through CSV or by
modifying some values directly in recorded script.

you can insert dynamic or random data into the XML using __Random and
__char functions nested in the XML.

So that everytime an xml is posted, the values will be random.

basically, just define your xml structure and use the __random and __char
functions nested in each other to randomly create any random text/numbers.
Then use the __time function to generate date/time data.

you need to send an XML then some SOAP/XML-RPC sampler is to be used. In
such a case, all you need is just put a template with params into
SOAP-XML-RPC Data field. <soapenv:Envelope xmlns:soapenv="
schemas.xmlsoap.org/soap/envelope/"><http://schemas.xmlsoap.org/soap/envelope/%22%3E>;
<soapenv:Body> <ns2:SomeActionRequest xmlns:ns2="urn:some:namespace">
<ns2:Param1>${paramFirst}</ns2:Param1> </ns2:SomeActionRequest>
</soapenv:Body> </soapenv:Envelope> If you're limited with plain HTTP, then
XML is to be sent as a get/post param, right? Then just add params to your
HTTP Request sampler.

JMeter guidelines strongly recommend to use pre-generated data to have good
perfomance and accuracy.

The task could be done via CSV Data Set Config component (Best
Practices<http://jakarta.apache.org/jmeter/usermanual/best-practices.html>,
section 16.5). The main idea is to generate a big test data set, save it to
text file and then use as params in request template (line of CSV file per
request). One can put whole request as one and only param if s/he wish.

Please be noted that JMeter 2.3.4 (latest version atm) has some
restrictions:

   - it doesn't understand multiline values (though such ones supported by
   CSV standard itself), so escaping might be required;
   - it doesn't understand column names, so it is possible to associate
   variables by column position only (not by logical name unfortunately).

Thanks,
-- 
M. Srinivas