vikranthsanka15
10 years agoOccasional Contributor
copying the SOAP Response into a notepad
I have a webservice ,on running the webservice request my Soap response gets me a Random 16 digit MemberNumber.I save this MemberNumber from response into a notepad using the following groovy code
def request = context.expand( '${CreateMember#Response# //ns2:CreateMemberResponse[1]/ns2:CreateMemberResult[1]/ns2:Epsilon[1]/ns2:Response[1]/ns2:GetMemberLookupReply[1]/ns2:Members[1]/ns2:Member[1]/ns2:MemberNumber[1]}')
new File( "C:/Users/vikranth_sanka/Desktop/membernumber.txt" ).write(request, "UTF-8" )
1.on running this script membernumber is saved into this notepad(membernumber.txt)
2.When I run the same script again, this time new data overwrites the previously saved data in the notepad(i.e., membernumber.txt)
3.My Requirement is whenever I execute the Script the newly generated membernumber from my SOAP response should be appended to the data in the notepad(that means all the membernumbers generated from soap response should be stored in the same notepad seperated by a delimiter or space)
Please help me guys.
Thanks in Advance.
def request = context.expand( '${CreateMember#Response# //ns2:CreateMemberResponse[1]/ns2:CreateMemberResult[1]/ns2:Epsilon[1]/ns2:Response[1]/ns2:GetMemberLookupReply[1]/ns2:Members[1]/ns2:Member[1]/ns2:MemberNumber[1]}')
new File( "C:/Users/vikranth_sanka/Desktop/membernumber.txt" ).write(request, "UTF-8" )
1.on running this script membernumber is saved into this notepad(membernumber.txt)
2.When I run the same script again, this time new data overwrites the previously saved data in the notepad(i.e., membernumber.txt)
3.My Requirement is whenever I execute the Script the newly generated membernumber from my SOAP response should be appended to the data in the notepad(that means all the membernumbers generated from soap response should be stored in the same notepad seperated by a delimiter or space)
Please help me guys.
Thanks in Advance.