Forum Discussion
You can turn a request like this:
<request> <a>${a}</a> <b>${b}</a> <ParticipantCount>${age1}</ParticipantCount>
<ParticipantCount>${age2}</ParticipantCount>
<ParticipantCount>${age3}</ParticipantCount>
</request>
Into one like this:
<request> <a>${a}</a> <b>${b}</a> ${participants}
</request>
Then you just need to build 'participants' with some sort of a loop across all the data.
String s = "" for (Participant p : getParticipants()) { s += "<ParticipantCount>${p.age}</ParticipantCount>\n" } context['participantsAsXml'] = s
Is that what you meant?
- MRAO7 years agoNew Contributor
Hi wasnt able to understand it properly can u please give a detail on it please find updated Request XML
<InterfaceRQ xmlns="*****">
<RequestHeader>
<UserID>${#TestSuite#UserID}</UserID>
<SessionID>${#TestSuite#SessionID}</SessionID>
<TransactionID>${#TestSuite#TransactionID}</TransactionID>
<SupplierCredentialsList>
<SupplierCredentials>
<SupplierID>${#TestSuite#SupplierID}</SupplierID>
<Sequence>1</Sequence>
<Credentials>
<Credential name="${#TestSuite#CredOne}" isEncrypted="${#TestSuite#Encyp}">${#TestSuite#USERNAME}</Credential>
<OperationURLs>
<OperationURL operation="all">${#TestSuite#OperationURL}</OperationURL>
</OperationURLs>
</Credentials>
</SupplierCredentials>
</SupplierCredentialsList>
</RequestHeader>
<RequestBody>
<OTA_TourAvailRQ>
<ProcessingInformation PricingCurrency="${#TestSuite#PricingCurrency}"/>
<Tour>
<Location>
<Address>
<CountryName Code="${#TestSuite#CountryName}"/>
</Address>
<Region RegionCode="${#TestSuite#RegionCode}" />
</Location>
<Schedule StartPeriod="${#TestSuite#StartPeriod}" EndPeriod="${#TestSuite#EndPeriod}"/>
<Participant Quantity="${#TestSuite#Quantity}" Age="${#TestSuite#Age}">
<QualifierInfo Extension="">${#TestSuite#Extension}</QualifierInfo>
<!-- Value Can be Adult,Child,Infant -->
</Participant>
</Tour>
</OTA_TourAvailRQ>
</RequestBody>
</SightSeeingInterfaceRQ>- nmrao7 years agoChampion Level 3In the above xml, there is no "ParticipantCount". Is it missing?
Related Content
- 11 years ago
- 12 years ago
- 2 years ago
- 10 years ago
Recent Discussions
- 15 years ago