Hello expert,
I have data contract of Header and Detail, lets say Header class name is MyHeader and Detail class is MyDetail, which is as normal the detail is declared in Header data contract as a list just at the bottom of the Header data contract, something like this :
[DataMember(/myDetails/),
DataCollection(Types::Class, classStr(myDetail)),
AifCollectionTypeAttribute('_myDetails', Types::Class,classStr(myDetail)),
AifCollectionTypeAttribute('return', Types::Class,classStr(myDetail))]
public List parmMyDetails(List _myDetails = myDetails)
{
if (!prmIsDefault(_myDetails))
{
myDetails = _myDetails;
}
return myDetails;
}
And how the code run later in my API is something like :
myHeader response = new myHeader();
and there is new variable List myList to cater all the information to pass to Detail data contract.
There is actually nothing's wrong to pass on the details, which usually by create a list variable as well and pass it to the response like this :
response.parmMyDetails(myList)
Up to here is fine. But currently I have intention to retrieve again what's passed to that response.parmMyDetails and put in a string variable.
May I know how to do this ?
I think we cannot just call again this /response.parmMyDetails/, and put it in the list, like below :
ListIterator listIterator = new ListIterator(response.parmMyDetails());
how can I achieve my intention, to retrieve again the list ? This retrieval, btw, is still inside the same function, so my API process actually already run well up to pass to API response, but now I'm gonna need to have addition of getting those details back into a string, for other purpose (logging)
Sorry, understand this can be confusing.
Let me know if I need to rephrase all this. Thanks.