AnsweredAssumed Answered

Dynamic response based on dataset

Question asked by saravanan77 on May 14, 2014
Latest reply on Sep 10, 2015 by AnkushSharma62132828

 

Hi,
 
I am trying to virtualize webservices component using LISA.  
 
Example request/response SOAP message :-
 
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns1:Request>
<ns1:field1>req1</ns1:field1>
</ns1:Request>
</soap:Body>
</soap:Envelope>
 
 
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns1:Response>
<ns1:field1>field1_rsp1</ns1:field1>
<ns1:field2>field2_rsp2</ns1:field2>
<ns1:field3>field3_rsp3</ns1:field3>
</ns1:Response>
</soap:Body>
</soap:Envelope>
 
What we wanted is based on Request field1 value("req1"), responses needs to be generated.  Say for example,
 
if Request field1 is "req2"
then Response field1 should be "field1_rsp2", field2 should be "field2_rsp2" etc.
 
Without creating mulitiple static Response XML for each request field1 value, is there any way to do it using scripting ? We use excel sheet to maintain this request response mapping.  Is there any way to use it inside the Response script editor ?
 
Saravanan A

Outcomes