I'm trying to create the script for WSDL soap services and my requirement is i want to print points response output parameter value into a csv results file using Beanshell Postporcessor.
Below is the response of SOAP.
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Body>
<CardResponse xmlns="http://service.clp.eks.com">
<out>
<birthDate xmlns="http://wsform.clp.eks.com">05-04-00</birthDate>
<cardno xsi:nil="true" xmlns="http://wsform.clp.eks.com"/>
<customerName xmlns="http://wsform.clp.eks.com">krishna singhji</customerName>
<flag xmlns="http://wsform.clp.eks.com">TRUE</flag>
<memberLevel xsi:nil="true" xmlns="http://wsform.clp.eks.com"/>
<points xmlns="http://wsform.clp.eks.com">**500.0**</points>
<reason xsi:nil="true" xmlns="http://wsform.clp.eks.com"/>
</out>
</CardResponse>
</soap:Body>
</soap:Envelope>
My Beanshell Script is :
import java.io.File;
import org.apache.jmeter.services.FileServer;
CardNo =vars.get("cardno");
Result = "FAIL";
Response = prev.getResponseDataAsString();
if(Response.contains("TRUE"))
Result = "PASS";
Points = vars.get("points");
f = new FileOutputStream("F:\\Java_Applications\\apache-jmeter-3.1\\bin\\CardsResults.csv",true);
p=new PrintStream(f);
this.interpreter.setOut(p);
p.println(CardNo + "," + Points + "," + Result);
f.close();
After running the TestPlan my results file not displaying value for points and displaying as null value,Please help me how to resolve this issue.ASAP