cancel
Showing results for 
Search instead for 
Did you mean: 

How do i prepare requests with repeated blocks having unique number in each blocks ?

Community Hero

Re: How do i prepare requests with repeated blocks having unique number in each blocks ?

@Apoorva6, have you looked at example from my previous response? Was it useful? Have you tried any later?


Regards,
Rao.
Established Member

Re: How do i prepare requests with repeated blocks having unique number in each blocks ?

Hi All,

 

I have web service request in which particular part (<Property>) will be repeated maximum of 1000 times. We have scenarios for single property as well as bulk property values. I have prepared datasheet in excel for single property in ReadyApi. There are totally 15 fields in the request xml and we pass only 'ExternalReference' with UUID and Fastingnickel on selection basis and <Property> tag with necessary details. When we pass values in <Property> tag then 'ExternalReference' is not needed and vice versa. I am facing difficulties in preparing the same for bulk property (reqeust is as below). Kindly help me with groovy code for the same as I am working with Groovy and ReadyApi for the first time.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="lf.se/SakDSL/Common/Property/WSDL/GetFormOfHousing/v1.0" xmlns:v11="lf.se/SakDSL/Common/Property/BO/GetFormOfHousing/v1.0" xmlns:v4="lf.se/SakDSL/CallerContext/v4.1">

   <soapenv:Header/>

   <soapenv:Body>

      <v1:RequestBody>

         <v11:InputParameters>

            <v11Smiley TongueropertyList>

               <!--1 or more repetitions:-->

               <v11Smiley Tongueroperty>

                  <!--Optional:-->

                  <v11:ExternalReference/>

                  <!--Optional:-->

                  <v11Smiley TongueostalAddress>

                     <!--Optional:-->

                     <v11Smiley Frustratedtreet>Staveläng 8</v11Smiley Frustratedtreet>

                     <!--Optional:-->

                     <v11Smiley Frustratedtreet2/>

                     <v11Smiley TongueostalCode>71693</v11Smiley TongueostalCode>

                     <v11:City>Fjugesta</v11:City>

                  </v11Smiley TongueostalAddress>

                  <!--Optional:-->

                  <v11:RecordReference>0</v11:RecordReference>

               </v11Smiley Tongueroperty>

               <v11Smiley Tongueroperty>

                  <!--Optional:-->

                  <v11:ExternalReference/>

                  <!--Optional:-->

                  <v11Smiley TongueostalAddress>

                     <!--Optional:-->

                     <v11Smiley Frustratedtreet>Fåruddsvägen 16</v11Smiley Frustratedtreet>

                     <!--Optional:-->

                     <v11Smiley Frustratedtreet2/>

                     <v11Smiley TongueostalCode>13466</v11Smiley TongueostalCode>

                     <v11:City>Ingarö</v11:City>

                  </v11Smiley TongueostalAddress>

                  <!--Optional:-->

                  <v11:RecordReference>1</v11:RecordReference>

               </v11Smiley Tongueroperty>

               <v11Smiley Tongueroperty>

                  <!--Optional:-->

                  <v11:ExternalReference/>

                  <!--Optional:-->

                  <v11Smiley TongueostalAddress>

                     <!--Optional:-->

                     <v11Smiley Frustratedtreet>Sjögärde 2</v11Smiley Frustratedtreet>

                     <!--Optional:-->

                     <v11Smiley Frustratedtreet2/>

                     <v11Smiley TongueostalCode>51995</v11Smiley TongueostalCode>

                     <v11:City>Tostared</v11:City>

                  </v11Smiley TongueostalAddress>

                  <!--Optional:-->

                  <v11:RecordReference>2</v11:RecordReference>

               </v11Smiley Tongueroperty>

            </v11Smiley TongueropertyList>

            <!--Optional:-->

            <v11:LogReference>1</v11:LogReference>

         </v11:InputParameters>

         <v4:RequestContext>

            <!--1 to 2 repetitions:-->

<v4Smiley FrustratedecurityTokenList>|LfTicket|r5DW0mfM//LkuhdQTP/Sr/iSK+oex6vn/2o4O7t3eOusGxv/hfvCf2FhBOBIjpYu9qH4SJEj1MdhqgvGQhbPpzf7i6NZGYzb6kuzAwvCljhLn+d0Coay1fwOrT3rml46S7hdxZV/N/KFAqnhKqiZA/IzKinriJ0NS8Lpd+Q1kronG10YVP6LUh7BE2tQVDARJuSJSVJKStx2FP2JGvh0bkWorV4ZCxuarpAiVyT15Y6Q+YgQWRL/tfZs1QnOb3U6Ar8u9POgLz0Iic+M5oJOYdatddWYDsjy75tv/J8tQG2exNgl7t9NWH58Oy2tCUQQB5LmSo+tvvPQPd9G/4hcJb4EApUgBM2UB6eeaE2R+78=</v4Smiley FrustratedecurityTokenList>

            <v4Smiley SurprisedriginalCaller>DSL</v4Smiley SurprisedriginalCaller>

            <v4Smiley FrustratedysCode>DS</v4Smiley FrustratedysCode>

            <v4:TransID>12345</v4:TransID>

            <v4:Timestamp>2018-05-08T00:00:00.000+02:00</v4:Timestamp>

            <!--1 to 2 repetitions:-->

            <v4:MachineIPList>

               <v4:MachineIP>1.1.1.1</v4:MachineIP>

               <v4:MachineContext>CallingMachine</v4:MachineContext>

            </v4:MachineIPList>

            <!--Optional:-->

            <v4:Environment>DEV</v4:Environment>

         </v4:RequestContext>

      </v1:RequestBody>

   </soapenv:Body>

</soapenv:Envelope>

New Here?
Join us and watch the welcome video:
Top Kudoed Authors