Hi,
I am trying to give dynamical values in webservices component using LISA.
Example request/response SOAP message :-
< soap:Envelope>
< soap:Body>
< ns1:Request>
< ns1:field1>1000</ns1:field1>
< /ns1:Request>
< /soap:Body>
< /soap:Envelope>
Response-->
< soap:Envelope>
< soap:Body>
< ns1:Response>
< ns1:field1>state1</ns1:field1>
< ns1:field2>country1</ns1:field2>
< /ns1:Response>
< /soap:Body>
< /soap:Envelope>
What we want is based on Request field1 value response should be generated as field1, field2
Say for example,
if Request field1 is 2000
then Response field1 should be
state2
country2
We use excel sheet to maintain this request response data because it is a small data no need of database. Is there any way to do it using scripting?
I'm not sure I understand completely, but this should be pretty easy overall..
1. change the response message description to use a property value {{=someproperty}} instead of a hard coded value 'state1'
2. create a script step, or use a script data protocol handler ( attached to some step). the script steps can do just about anything. it will set the property, based on your algorithm
you might be able to read the data into memory and work from there. the {{= will allow you to put some java code in place of the property name, so u might no need a script at all)
I use script step and apache poi classes to read excel (xlsx) sheets which contain request and response data (JSON), but its just fields.
I am using DevTest V8.1, but I don't see that much different back on 7.5.2