Hi Jayesh,
You can do this by following the below steps:
1. Add Regular Expression Extractor to extract value using the settings:
Reference Name: xxx
Regular Expression: <TagName>(.+?)</TagName>
Template: $1$
Match No: -1
2. Add BeanShell PostProcessor and build java code to read the xml response
and writing it to a csv file.
I did the same kind of solution to extract values from the response xml.
below is some code with which you can start with:
--------------------------------------------------------------------------------------------
String yyy = vars.get("xxx");
response = prev.getResponseDataAsString().toLowerCase(Locale.US);
BufferedWriter outLoge = new BufferedWriter(new FileWriter("<CSV file
path>", true));
outLoge.write(yyy);
--------------------------------------------------------------------------------------------
Hope this will give you a good start.
Regards,
Kiran
On Tue, Jan 21, 2014 at 8:51 PM, sebb <[email protected]> wrote:
> On 22 January 2014 00:51, Jayesh Guru <[email protected]> wrote:
> > Hello,
> >
> > I am trying to find a way to save XML response fields in a csv file in
> > SOAP/XML-RPC Request Sampler.
>
> Not possible; responses can only be saved in XML files.
>
> > eg. in below response i want to save securityCode Values in a csv file
> >
> > <?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="
> > http://schemas.xmlsoap.org/soap/envelope/
> "><soapenv:Body><ns5:GenerateSecurityCodeResponse
> > xmlns:ns5="http://mpsys.ril.att.com/generatesecuritycoderesponse/v1"
> xmlns="
> > http://cio.att.com/commonheader/v3" xmlns:ns6="
> > http://mpsys.ril.att.com/verifysecuritycoderequest/v1" xmlns:ns7="
> > http://mpsys.ril.att.com/verifysecuritycoderesponse/v1" xmlns:ns2="
> > http://mpsys.ril.att.com/deletesecuritycoderequest/v1" xmlns:ns3="
> > http://mpsys.ril.att.com/deletesecuritycoderesponse/v1" xmlns:ns4="
> > http://mpsys.ril.att.com/generatesecuritycoderequest/v1
> > "><ns5:transactionId>GSBCss02</ns5:transactionId>
> > *<ns5:securityCode>43101112</ns5:securityCode>*
> >
> <ns5:securityCodeExpires>02102011</ns5:securityCodeExpires></ns5:GenerateSecurityCodeResponse></soapenv:Body></soapenv:Envelope>
> >
> > Can Anyone help me in this regard?
> >
> > *Thanks *
> > *Jayesh Guru*
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
--
Regards,
Kiran