Intermountain_H_3
14 years agoContributor
Build the request using the response of another method
Hi,
We have few methods in a service like add, append, delete. But the default created request has only one Item. so while testing the append, I would like to delete few of existing items and then append few of items. For this I would like to build the request dynamically with the items. Wanting to keep this as simple as possible, I would like to have suggestions on that. Below is the sample request for the append, have highlighted the structure which has to be dynamically added for multiple items (cListItem has cardinality 0...*). Before running the append, I run get and get the list of items for UserA to add the items to UserB. Currently I am adding by one item after another in the datasource loop, datasource is xml response of the get. But would like to add all the items at one time instead of loop, so need help with that. Any help is appreciated.
<soapenv:Body>
<com:appendCListItems>
<FromUserID>${#TestCase#UserA}</FromUserID>
<ToUserID>${#TestCase#UserB}</ToUserID>
<OrderType>${#TestCase#orderType}</OrderType>
<CListItem>
<cListItemId>${DataSource 2#clid}</cListItemId>
<status>true</status>
</CListItem>
</com:appendCListItems>
</soapenv:Body>
Thanks,
Raj
We have few methods in a service like add, append, delete. But the default created request has only one Item. so while testing the append, I would like to delete few of existing items and then append few of items. For this I would like to build the request dynamically with the items. Wanting to keep this as simple as possible, I would like to have suggestions on that. Below is the sample request for the append, have highlighted the structure which has to be dynamically added for multiple items (cListItem has cardinality 0...*). Before running the append, I run get and get the list of items for UserA to add the items to UserB. Currently I am adding by one item after another in the datasource loop, datasource is xml response of the get. But would like to add all the items at one time instead of loop, so need help with that. Any help is appreciated.
<soapenv:Body>
<com:appendCListItems>
<FromUserID>${#TestCase#UserA}</FromUserID>
<ToUserID>${#TestCase#UserB}</ToUserID>
<OrderType>${#TestCase#orderType}</OrderType>
<CListItem>
<cListItemId>${DataSource 2#clid}</cListItemId>
<status>true</status>
</CListItem>
</com:appendCListItems>
</soapenv:Body>
Thanks,
Raj