cancel
Showing results for 
Search instead for 
Did you mean: 

Read & Loop multiple requests and response

Occasional Contributor

Read & Loop multiple requests and response

Multiple Request:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header/>
<soapenv:Body>
<MIKESmiley TongueFU>
<uId>?</uId>
<p>?</p>
<UFL>
<MIKE:UFD>
<MIKE:NVPFF>
<MIKE:name>NULL</MIKE:name>
<MIKE:value>NULL</MIKE:value>
</MIKE:NVPFF>
<MIKE:wII>105</MIKE:wII>
<MIKE:b>659-458</MIKE:b>
<MIKE:fT>P1B</MIKE:fT>
<MIKE:action/>
</MIKE:UFD>
<MIKE:UFD>
<MIKE:NVPFF>
<MIKE:name>NULL</MIKE:name>
<MIKE:value>NULL</MIKE:value>
</MIKE:NVPFF>
<MIKE:wII>363</MIKE:wII>
<MIKE:b>756-124</MIKE:b>
<MIKE:fT>P1B</MIKE:fT>
<MIKE:action/>
</MIKE:UFD>
<MIKE:UFD>
<MIKE:NVPFF>
<MIKE:name>NULL</MIKE:name>
<MIKE:value>NULL</MIKE:value>
</MIKE:NVPFF>
<MIKE:wII>354</MIKE:wII>
<MIKE:b>741-652</MIKE:b>
<MIKE:fT>P1B</MIKE:fT>
<MIKE:action/>
</MIKE:UFD>
</UFL>
</MIKESmiley TongueFU>
</soapenv:Body>
</soapenv:Envelope>

Response: Loop the request and for each UFD send Response with wII, b, s, and sM shown below.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header/>
<soapenv:Body>
<MIKESmiley TongueFUR>
<RSL>
<MIKE:RS>
<MIKE:wII>105</MIKE:wII>
<MIKE:b>659-458</MIKE:b>
<MIKE:s>Success</MIKE:s>
<MIKE:sM>Successfully updated for: 659-458; 105; P1B</MIKE:sM>
</MIKE:RS>
</RSL>
</MIKESmiley TongueFUR>
</soapenv:Body>
</soapenv:Envelope>

3 REPLIES 3
Community Hero

Re: Read & Loop multiple requests and response

What is the question? What is your use case? How to reproduce it by others?


Regards,
Rao.
Occasional Contributor

Re: Read & Loop multiple requests and response

Sorry for not clearly asking the question. Here is the issue.

1) In Ready! API 1.9.0, under projects, I imported the wsdl then sending following request

<soapenv:Envelope xmlns:soapenv="http://../">
    <soapenv:Header/>
    <soapenv:Body>
        <MIKESmiley:TongueFU>
            <uId>?</uId>
            <p>?</p>
            <UFL>
                <MIKE:UFD>
                    <MIKE:NVPFF>
                        <MIKE:name>NULL</MIKE:name>
                        <MIKE:value>NULL</MIKE:value>
                    </MIKE:NVPFF>
                    <MIKE:wII>105</MIKE:wII>
                    <MIKE:b>659-458</MIKE:b>
                    <MIKE:fT>P1B</MIKE:fT>
                    <MIKE:action/>
                </MIKE:UFD>
            </UFL>
        </MIKESmiley:TongueFU>
    </soapenv:Body>
</soapenv:Envelope>

 

2) Under ServiceV, I have following Script

def blockValue="XX";
def groovyUtils=new com.eviware.soapui.support.GroovyUtils(context)
def xml=new XmlSlurper().parseText(mockRequest.requestContent)
xml.breadthFirst().each{
        if(it.name()=="b"){
                bValue=it.text();
                context.setProperty("BVALUE", bValue);                
        }
        if(it.name()=="wII"){
                wIIValue=it.text();
                context.setProperty("WII", wIIValue);                
        }
        if(it.name()=="fT"){
                fTValue=it.text();                
                context.setProperty("FT", fTValue);
        }   
}
context.setProperty("STATUSMESSAGE1", "Updated for: ${bValue}; ${wIIValue};");

 

3) Under Response, I have following

<soapenv:Envelope xmlns:soapenv="http://..." xmlns:map="https://test.com/">
   <soapenv:Header/>
   <soapenv:Body>
      <pasSmiley TongueFUR>
         <RSL>
            <pas:RS>
            <pas:wII>${wIIValue}</pas:wII>
            <pas:b>${bValue}</pas:b>
            <pas:statusMessage>${STATUSMESSAGE1}</pas:statusMessage>
            </pas:RS>
         </RSL>
      </pasSmiley TongueFUR>
   </soapenv:Body>
</soapenv:Envelope>

 

4) I get correct response, no issues so far.

 

5) Now, I send following request

<soapenv:Envelope xmlns:soapenv="http://../">
    <soapenv:Header/>
    <soapenv:Body>
        <MIKESmiley:TongueFU>
            <uId>?</uId>
            <p>?</p>
            <UFL>
                <MIKE:UFD>
                    <MIKE:NVPFF>
                        <MIKE:name>NULL</MIKE:name>
                        <MIKE:value>NULL</MIKE:value>
                    </MIKE:NVPFF>
                    <MIKE:wII>105</MIKE:wII>
                    <MIKE:b>659-458</MIKE:b>
                    <MIKE:fT>P1B</MIKE:fT>
                    <MIKE:action/>
                </MIKE:UFD>

                <MIKE:UFD>
                    <MIKE:NVPFF>
                        <MIKE:name>NULL</MIKE:name>
                        <MIKE:value>NULL</MIKE:value>
                    </MIKE:NVPFF>
                    <MIKE:wII>106</MIKE:wII>
                    <MIKE:b>659-459</MIKE:b>
                    <MIKE:fT>P1B</MIKE:fT>
                    <MIKE:action/>
                </MIKE:UFD>
            </UFL>
        </MIKESmiley:TongueFU>
    </soapenv:Body>
</soapenv:Envelope>

 

6) Issue: I only received a response that is highlighted in Red. I DO NOT get response for 105 and 106.

 

Can someone please help?

Community Hero

Re: Read & Loop multiple requests and response

Because, it is working as per the script.

What is the expected response message (xml ) please?


Regards,
Rao.
New Here?
Join us and watch the welcome video:
Watch the new Interview
Top Kudoed Authors