Forum Discussion
Hi Rao,
yes, I am still looking for an answer. I need to fill the data from external file. In external xls file, I have the <oew:inventoryId> values in first column and according to its total numbers, we need so many blocks of oewServiceDetails.
Only <oew:inventoryId> should be unique in oewServiceDetails.
If my xls has 600 <oew:inventoryId> then my script should be able to fetch all 600 values , make a request with 600 blocks and then run the request.
Then can you please send the sample data (preferably csv) file (you could save your excel file as csv file as well).
- Apoorva68 years agoFrequent Contributor
CSV will work for me. attached is sample file with 20 unique oewInvId's. In this case script should read number of InvId and should prepare one final request of 20 blocks and run the step.
Thanks for the reply.
- nmrao8 years agoChampion Level 3The file you attached is the entire data or any more data is missing? Because the solution would directly depends on the data.
Anyways, you have a look at the below thread which I did some time ago. May be if you still have issue, then share the full sample data.
https://stackoverflow.com/questions/37956927/groovy-reference-repeating-nodes-values-in-xml-with-xpath-interpolation-misuse/37958846#379588 - nmrao8 years agoChampion Level 3Apoorva6, have you looked at example from my previous response? Was it useful? Have you tried any later?
- halyalanant6 years agoEstablished Member
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>
<v11:PropertyList>
<!--1 or more repetitions:-->
<v11:Property>
<!--Optional:-->
<v11:ExternalReference/>
<!--Optional:-->
<v11:PostalAddress>
<!--Optional:-->
<v11:Street>Staveläng 8</v11:Street>
<!--Optional:-->
<v11:Street2/>
<v11:PostalCode>71693</v11:PostalCode>
<v11:City>Fjugesta</v11:City>
</v11:PostalAddress>
<!--Optional:-->
<v11:RecordReference>0</v11:RecordReference>
</v11:Property>
<v11:Property>
<!--Optional:-->
<v11:ExternalReference/>
<!--Optional:-->
<v11:PostalAddress>
<!--Optional:-->
<v11:Street>Fåruddsvägen 16</v11:Street>
<!--Optional:-->
<v11:Street2/>
<v11:PostalCode>13466</v11:PostalCode>
<v11:City>Ingarö</v11:City>
</v11:PostalAddress>
<!--Optional:-->
<v11:RecordReference>1</v11:RecordReference>
</v11:Property>
<v11:Property>
<!--Optional:-->
<v11:ExternalReference/>
<!--Optional:-->
<v11:PostalAddress>
<!--Optional:-->
<v11:Street>Sjögärde 2</v11:Street>
<!--Optional:-->
<v11:Street2/>
<v11:PostalCode>51995</v11:PostalCode>
<v11:City>Tostared</v11:City>
</v11:PostalAddress>
<!--Optional:-->
<v11:RecordReference>2</v11:RecordReference>
</v11:Property>
</v11:PropertyList>
<!--Optional:-->
<v11:LogReference>1</v11:LogReference>
</v11:InputParameters>
<v4:RequestContext>
<!--1 to 2 repetitions:-->
<v4:SecurityTokenList>|LfTicket|r5DW0mfM//LkuhdQTP/Sr/iSK+oex6vn/2o4O7t3eOusGxv/hfvCf2FhBOBIjpYu9qH4SJEj1MdhqgvGQhbPpzf7i6NZGYzb6kuzAwvCljhLn+d0Coay1fwOrT3rml46S7hdxZV/N/KFAqnhKqiZA/IzKinriJ0NS8Lpd+Q1kronG10YVP6LUh7BE2tQVDARJuSJSVJKStx2FP2JGvh0bkWorV4ZCxuarpAiVyT15Y6Q+YgQWRL/tfZs1QnOb3U6Ar8u9POgLz0Iic+M5oJOYdatddWYDsjy75tv/J8tQG2exNgl7t9NWH58Oy2tCUQQB5LmSo+tvvPQPd9G/4hcJb4EApUgBM2UB6eeaE2R+78=</v4:SecurityTokenList>
<v4:OriginalCaller>DSL</v4:OriginalCaller>
<v4:SysCode>DS</v4:SysCode>
<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>
Related Content
- 5 years ago
- 11 years ago
- 3 years ago
- 9 years ago
Recent Discussions
- 3 days ago