Unable to retrieve response object allocated in the last method of a nested SendRequestSync sequence
Hi,
I have a production with a BS calling a BP calling another BP and so on and finally a BO. All calls are made using SendRequestSync.
The initial request is passed by value. The response is passed by ref and I allocate memory for it in the BO, hoping that it will go back to the initial caller in the BS, but it does not.
It looks like the following:
// In BS, do not allocate response, call BP1
Set tSC = SendRequestSync(request, .response)
// In BP1, call BP2. Now I don't know if .response is a reference to a reference
Set tSC = SendRequestSync(request, .response)
// In BP2, call BP3. Now I don't know if .response is a reference to a reference to a reference
Set tSC = SendRequestSync(request, .response)
// Do some stuff with reqa and reqb an then the last one supposed to allocate response
Set tSC = SendRequestSync(reqc, .response)
I have tried many combinations of reference of values, does not work. Why is the response NULLed and I can't retrieve it in the initial caller ?
Override OnResponse method in bps . You can handle reponses in OnResponse() method.
Hi,
I don't really get it, I don't understand the flow.
The documentation says :
But I want a synced request.
Set tSC = SendRequestSync(request, .response)
// Now I continue the flow from here ... but you're telling me I should handle in OnResponse() ... but how do I take control right back here if I use OnResponse() +?
Problem is solved, it was my fault. I forgot a '.' in one of the many nested calls ...
The thing to remember is to pass the response argument by reference everywhere, from REST to BO1.