Question
· Mar 1, 2020

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 ?

 

Discussion (3)1
Log in or sign up to continue

Hi,

I don't really get it, I don't understand the flow.

The documentation says :

structure your code to use SendRequestAsync() instead of this method, and handle response messages in the OnResponse() callback method

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() +?