You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Nirodha Pramod <ni...@wso2.com> on 2012/01/26 11:18:27 UTC

Cannot replace the variables in a SOAP XML sampler when the request is read from a file.

Hi All,

I have encountered an issue when I use SOAP XML-RPC sampler where I read
the soap request from a file. I am using the 'CSV data set config' to read
data from from a csv file and I want to map those values in soap request.
When I give the soap request inside the text box given in the sampler, this
mapping works perfectly, but when  the same request is stored as a file and
the file is given, then it does not replace the variables with the data in
csv. It just sends the request as it is in the file (as follows)

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:typ="http//sample.com/reservation/guest/types">
   <soapenv:Header/>
   <soapenv:Body>
      <typ:addGuest>
         <typ:name>${name}</typ:name>
         <typ:address>${address}</typ:address>
         <typ:age>${age}</typ:age>
      </typ:addGuest>
   </soapenv:Body>
</soapenv:Envelope>

Have anyone come across this issue before. It would be great if some one
can suggest me a solution.
Jmeter Version : 2.5.1
Java Version : 1.6.27


Thanks in advance,
Nirodha

-- 
*Nirodha Gallage*
Software Engineer, QA.
WSO2 Inc.: http://wso2.com/
Email: nirodha@wso2.com   Mobile: +94716429078

Re: Cannot replace the variables in a SOAP XML sampler when the request is read from a file.

Posted by Philippe Mouawad <ph...@gmail.com>.
Maybe you can try:
__StringFromFile
 to read file in a var then use this var in textarea of XML

But with this approach, check before the sizes to avoid memory problems.

Regards
Philippe

On Thu, Jan 26, 2012 at 12:43 PM, Flavio Cysne <fl...@gmail.com>wrote:

> Maybe some If Controller's would help to support this dynamic sellection.
>
> 2012/1/26 Nirodha Pramod <ni...@wso2.com>
>
> > Hi Philippe,
> >
> > Thanks for the response. I need to read the request from a file since the
> > request is dynamically selected. Have to figure out some other way to map
> > those values in the request.
> >
> > Regards,
> > Nirodha
> >
> >
> > On Thu, Jan 26, 2012 at 3:53 PM, Philippe Mouawad <
> > philippe.mouawad@gmail.com> wrote:
> >
> > > Hello,
> > > Variable replacement is not supported in JMeter when content is loaded
> > from
> > > a file.
> > > If you use the TextArea then it will work
> > >
> > > It is an enhancement that may be implemented one day.
> > >
> > > Regards
> > > Philippe
> > >
> > > On Thu, Jan 26, 2012 at 11:18 AM, Nirodha Pramod <ni...@wso2.com>
> > wrote:
> > >
> > > > Hi All,
> > > >
> > > > I have encountered an issue when I use SOAP XML-RPC sampler where I
> > read
> > > > the soap request from a file. I am using the 'CSV data set config' to
> > > read
> > > > data from from a csv file and I want to map those values in soap
> > request.
> > > > When I give the soap request inside the text box given in the
> sampler,
> > > this
> > > > mapping works perfectly, but when  the same request is stored as a
> file
> > > and
> > > > the file is given, then it does not replace the variables with the
> data
> > > in
> > > > csv. It just sends the request as it is in the file (as follows)
> > > >
> > > > <soapenv:Envelope xmlns:soapenv="
> > > http://schemas.xmlsoap.org/soap/envelope/
> > > > "
> > > > xmlns:typ="http//sample.com/reservation/guest/types">
> > > >   <soapenv:Header/>
> > > >   <soapenv:Body>
> > > >      <typ:addGuest>
> > > >         <typ:name>${name}</typ:name>
> > > >         <typ:address>${address}</typ:address>
> > > >         <typ:age>${age}</typ:age>
> > > >      </typ:addGuest>
> > > >   </soapenv:Body>
> > > > </soapenv:Envelope>
> > > >
> > > > Have anyone come across this issue before. It would be great if some
> > one
> > > > can suggest me a solution.
> > > > Jmeter Version : 2.5.1
> > > > Java Version : 1.6.27
> > > >
> > > >
> > > > Thanks in advance,
> > > > Nirodha
> > > >
> > > > --
> > > > *Nirodha Gallage*
> > > > Software Engineer, QA.
> > > > WSO2 Inc.: http://wso2.com/
> > > > Email: nirodha@wso2.com   Mobile: +94716429078
> > > >
> > >
> > >
> > >
> > > --
> > > Cordialement.
> > > Philippe Mouawad.
> > >
> >
> >
> >
> > --
> > *Nirodha Gallage*
> > Software Engineer, QA.
> > WSO2 Inc.: http://wso2.com/
> > Email: nirodha@wso2.com   Mobile: +94716429078
> >
>



-- 
Cordialement.
Philippe Mouawad.

Re: Cannot replace the variables in a SOAP XML sampler when the request is read from a file.

Posted by Flavio Cysne <fl...@gmail.com>.
Maybe some If Controller's would help to support this dynamic sellection.

2012/1/26 Nirodha Pramod <ni...@wso2.com>

> Hi Philippe,
>
> Thanks for the response. I need to read the request from a file since the
> request is dynamically selected. Have to figure out some other way to map
> those values in the request.
>
> Regards,
> Nirodha
>
>
> On Thu, Jan 26, 2012 at 3:53 PM, Philippe Mouawad <
> philippe.mouawad@gmail.com> wrote:
>
> > Hello,
> > Variable replacement is not supported in JMeter when content is loaded
> from
> > a file.
> > If you use the TextArea then it will work
> >
> > It is an enhancement that may be implemented one day.
> >
> > Regards
> > Philippe
> >
> > On Thu, Jan 26, 2012 at 11:18 AM, Nirodha Pramod <ni...@wso2.com>
> wrote:
> >
> > > Hi All,
> > >
> > > I have encountered an issue when I use SOAP XML-RPC sampler where I
> read
> > > the soap request from a file. I am using the 'CSV data set config' to
> > read
> > > data from from a csv file and I want to map those values in soap
> request.
> > > When I give the soap request inside the text box given in the sampler,
> > this
> > > mapping works perfectly, but when  the same request is stored as a file
> > and
> > > the file is given, then it does not replace the variables with the data
> > in
> > > csv. It just sends the request as it is in the file (as follows)
> > >
> > > <soapenv:Envelope xmlns:soapenv="
> > http://schemas.xmlsoap.org/soap/envelope/
> > > "
> > > xmlns:typ="http//sample.com/reservation/guest/types">
> > >   <soapenv:Header/>
> > >   <soapenv:Body>
> > >      <typ:addGuest>
> > >         <typ:name>${name}</typ:name>
> > >         <typ:address>${address}</typ:address>
> > >         <typ:age>${age}</typ:age>
> > >      </typ:addGuest>
> > >   </soapenv:Body>
> > > </soapenv:Envelope>
> > >
> > > Have anyone come across this issue before. It would be great if some
> one
> > > can suggest me a solution.
> > > Jmeter Version : 2.5.1
> > > Java Version : 1.6.27
> > >
> > >
> > > Thanks in advance,
> > > Nirodha
> > >
> > > --
> > > *Nirodha Gallage*
> > > Software Engineer, QA.
> > > WSO2 Inc.: http://wso2.com/
> > > Email: nirodha@wso2.com   Mobile: +94716429078
> > >
> >
> >
> >
> > --
> > Cordialement.
> > Philippe Mouawad.
> >
>
>
>
> --
> *Nirodha Gallage*
> Software Engineer, QA.
> WSO2 Inc.: http://wso2.com/
> Email: nirodha@wso2.com   Mobile: +94716429078
>

Re: Cannot replace the variables in a SOAP XML sampler when the request is read from a file.

Posted by Deepak Shetty <sh...@gmail.com>.
Hi
something similar -
http://theworkaholic.blogspot.com/2011/02/dynamic-values-within-files.html

regards
deepak

On Thu, Jan 26, 2012 at 3:06 AM, Nirodha Pramod <ni...@wso2.com> wrote:

> Hi Philippe,
>
> Thanks for the response. I need to read the request from a file since the
> request is dynamically selected. Have to figure out some other way to map
> those values in the request.
>
> Regards,
> Nirodha
>
>
> On Thu, Jan 26, 2012 at 3:53 PM, Philippe Mouawad <
> philippe.mouawad@gmail.com> wrote:
>
> > Hello,
> > Variable replacement is not supported in JMeter when content is loaded
> from
> > a file.
> > If you use the TextArea then it will work
> >
> > It is an enhancement that may be implemented one day.
> >
> > Regards
> > Philippe
> >
> > On Thu, Jan 26, 2012 at 11:18 AM, Nirodha Pramod <ni...@wso2.com>
> wrote:
> >
> > > Hi All,
> > >
> > > I have encountered an issue when I use SOAP XML-RPC sampler where I
> read
> > > the soap request from a file. I am using the 'CSV data set config' to
> > read
> > > data from from a csv file and I want to map those values in soap
> request.
> > > When I give the soap request inside the text box given in the sampler,
> > this
> > > mapping works perfectly, but when  the same request is stored as a file
> > and
> > > the file is given, then it does not replace the variables with the data
> > in
> > > csv. It just sends the request as it is in the file (as follows)
> > >
> > > <soapenv:Envelope xmlns:soapenv="
> > http://schemas.xmlsoap.org/soap/envelope/
> > > "
> > > xmlns:typ="http//sample.com/reservation/guest/types">
> > >   <soapenv:Header/>
> > >   <soapenv:Body>
> > >      <typ:addGuest>
> > >         <typ:name>${name}</typ:name>
> > >         <typ:address>${address}</typ:address>
> > >         <typ:age>${age}</typ:age>
> > >      </typ:addGuest>
> > >   </soapenv:Body>
> > > </soapenv:Envelope>
> > >
> > > Have anyone come across this issue before. It would be great if some
> one
> > > can suggest me a solution.
> > > Jmeter Version : 2.5.1
> > > Java Version : 1.6.27
> > >
> > >
> > > Thanks in advance,
> > > Nirodha
> > >
> > > --
> > > *Nirodha Gallage*
> > > Software Engineer, QA.
> > > WSO2 Inc.: http://wso2.com/
> > > Email: nirodha@wso2.com   Mobile: +94716429078
> > >
> >
> >
> >
> > --
> > Cordialement.
> > Philippe Mouawad.
> >
>
>
>
> --
> *Nirodha Gallage*
> Software Engineer, QA.
> WSO2 Inc.: http://wso2.com/
> Email: nirodha@wso2.com   Mobile: +94716429078
>

Re: Cannot replace the variables in a SOAP XML sampler when the request is read from a file.

Posted by Nirodha Pramod <ni...@wso2.com>.
Hi Philippe,

Thanks for the response. I need to read the request from a file since the
request is dynamically selected. Have to figure out some other way to map
those values in the request.

Regards,
Nirodha


On Thu, Jan 26, 2012 at 3:53 PM, Philippe Mouawad <
philippe.mouawad@gmail.com> wrote:

> Hello,
> Variable replacement is not supported in JMeter when content is loaded from
> a file.
> If you use the TextArea then it will work
>
> It is an enhancement that may be implemented one day.
>
> Regards
> Philippe
>
> On Thu, Jan 26, 2012 at 11:18 AM, Nirodha Pramod <ni...@wso2.com> wrote:
>
> > Hi All,
> >
> > I have encountered an issue when I use SOAP XML-RPC sampler where I read
> > the soap request from a file. I am using the 'CSV data set config' to
> read
> > data from from a csv file and I want to map those values in soap request.
> > When I give the soap request inside the text box given in the sampler,
> this
> > mapping works perfectly, but when  the same request is stored as a file
> and
> > the file is given, then it does not replace the variables with the data
> in
> > csv. It just sends the request as it is in the file (as follows)
> >
> > <soapenv:Envelope xmlns:soapenv="
> http://schemas.xmlsoap.org/soap/envelope/
> > "
> > xmlns:typ="http//sample.com/reservation/guest/types">
> >   <soapenv:Header/>
> >   <soapenv:Body>
> >      <typ:addGuest>
> >         <typ:name>${name}</typ:name>
> >         <typ:address>${address}</typ:address>
> >         <typ:age>${age}</typ:age>
> >      </typ:addGuest>
> >   </soapenv:Body>
> > </soapenv:Envelope>
> >
> > Have anyone come across this issue before. It would be great if some one
> > can suggest me a solution.
> > Jmeter Version : 2.5.1
> > Java Version : 1.6.27
> >
> >
> > Thanks in advance,
> > Nirodha
> >
> > --
> > *Nirodha Gallage*
> > Software Engineer, QA.
> > WSO2 Inc.: http://wso2.com/
> > Email: nirodha@wso2.com   Mobile: +94716429078
> >
>
>
>
> --
> Cordialement.
> Philippe Mouawad.
>



-- 
*Nirodha Gallage*
Software Engineer, QA.
WSO2 Inc.: http://wso2.com/
Email: nirodha@wso2.com   Mobile: +94716429078

Re: Cannot replace the variables in a SOAP XML sampler when the request is read from a file.

Posted by Philippe Mouawad <ph...@gmail.com>.
Hello,
Variable replacement is not supported in JMeter when content is loaded from
a file.
If you use the TextArea then it will work

It is an enhancement that may be implemented one day.

Regards
Philippe

On Thu, Jan 26, 2012 at 11:18 AM, Nirodha Pramod <ni...@wso2.com> wrote:

> Hi All,
>
> I have encountered an issue when I use SOAP XML-RPC sampler where I read
> the soap request from a file. I am using the 'CSV data set config' to read
> data from from a csv file and I want to map those values in soap request.
> When I give the soap request inside the text box given in the sampler, this
> mapping works perfectly, but when  the same request is stored as a file and
> the file is given, then it does not replace the variables with the data in
> csv. It just sends the request as it is in the file (as follows)
>
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/
> "
> xmlns:typ="http//sample.com/reservation/guest/types">
>   <soapenv:Header/>
>   <soapenv:Body>
>      <typ:addGuest>
>         <typ:name>${name}</typ:name>
>         <typ:address>${address}</typ:address>
>         <typ:age>${age}</typ:age>
>      </typ:addGuest>
>   </soapenv:Body>
> </soapenv:Envelope>
>
> Have anyone come across this issue before. It would be great if some one
> can suggest me a solution.
> Jmeter Version : 2.5.1
> Java Version : 1.6.27
>
>
> Thanks in advance,
> Nirodha
>
> --
> *Nirodha Gallage*
> Software Engineer, QA.
> WSO2 Inc.: http://wso2.com/
> Email: nirodha@wso2.com   Mobile: +94716429078
>



-- 
Cordialement.
Philippe Mouawad.