In my webservices test plan, I am sending SOAP request to create user and it sends back username and unique id in the response data. I want to save that username and uniqueid in
You can extract data using Regex post processor and save it to a variable.
Simple data writer, Flexible data writer, Save results to a file all these can write predefined variables, responses to a file in a fixed or little bit customizable format but won't let you write your custom variables.
For writing it to a file you need to use Beanshell processor. Sample code would be,
username = vars.get("username");
password = vars.get("password");
f = new FileOutputStream("/path/user_details.csv", true);
p = new PrintStream(f);
this.interpreter.setOut(p);
print(username + "," + password);
f.close();