Client Event Script Message Handler

Hi everyone,

I would like to use the system.util.sendRequest function in a global script to call a message Handler defined in the Client Event Script Message part. Do you know how to do it? Every time i try to do it i have the following error :

The message handler “test” could not be found!

But here is what i get :

That is a client message handler. Are you specifying a project and scope of ‘C’ in your system.util.sendRequest call? Post your code to send the request here, if possible. If you aren’t specifying the scope argument, your outbound request is trying to find a gateway-scoped message handler - check the ‘Gateway Event Scripts’ section.

Huh. I thought sendRequest() could only be used in the client/designer to query the gateway.

1 Like

Oh, yeah, you’re probably right - so there’s not a scope argument missing, you’re just defining the message handler in the wrong place - it needs to be a ‘gateway message handler’, not a ‘client message handler’.

What a i need to do is to use Client Event Script Message to get the connection mode of all clients connected to the gateway. These Client Message Handlers should be abble to send me this kind of information no?

Yes, you can use sendMessage in the gateway with scope ‘C’ to invoke message handlers in the clients, separately for every possible project. Those client message handlers will have to also use sendMessage with scope ‘G’ to return the information collected. sendRequest can’t do this.

2 Likes

I will try this. Good to know ! I’ll come back to you after testing this :wink:

It’s not an elegant solution but I have a message handler that after doing it’s work, sends a message of it’s own. It’s not a response but shortly after sending a message, a message is received.

SendRequest() function is used for Gateway to Gateway Communication and it expect response to the message.