Discussion:
What all Hooks of HTTP Client Connector (in Passive Mode) would be executed?
(too old to reply)
Sufyan Khan
2017-03-17 11:24:24 UTC
Permalink
Raw Message
I am using HTTP Client Connector in Passive Mode, to get Hooks executed I am using HTTPConnector.callreply(Entry) api instead of HTTPConnector.connector.queryReply(Entry), so just want to know what all hooks of the connector would be executed.
Eddie Hartman
2017-03-17 23:44:21 UTC
Permalink
Raw Message
Post by Sufyan Khan
I am using HTTP Client Connector in Passive Mode, to get Hooks executed I am using HTTPConnector.callreply(Entry) api instead of HTTPConnector.connector.queryReply(Entry), so just want to know what all hooks of the connector would be executed.
You can open the Hooks tab with the Connector in this mode and see what happens under the CallReply branch: so Output Map, Before CallReply, After CallReply and Input Map.
Sufyan Khan
2017-03-19 11:51:14 UTC
Permalink
Raw Message
Post by Eddie Hartman
Post by Sufyan Khan
I am using HTTP Client Connector in Passive Mode, to get Hooks executed I am using HTTPConnector.callreply(Entry) api instead of HTTPConnector.connector.queryReply(Entry), so just want to know what all hooks of the connector would be executed.
You can open the Hooks tab with the Connector in this mode and see what happens under the CallReply branch: so Output Map, Before CallReply, After CallReply and Input Map.
Thanks Eddie...!
Sufyan Khan
2017-03-19 11:55:52 UTC
Permalink
Raw Message
Post by Eddie Hartman
Post by Sufyan Khan
I am using HTTP Client Connector in Passive Mode, to get Hooks executed I am using HTTPConnector.callreply(Entry) api instead of HTTPConnector.connector.queryReply(Entry), so just want to know what all hooks of the connector would be executed.
You can open the Hooks tab with the Connector in this mode and see what happens under the CallReply branch: so Output Map, Before CallReply, After CallReply and Input Map.
Actually I have to make an HTTP call 4~5 times so instead of using 4~5 connectors I am using 1 connector in Passive mode and from script I am setting params and executing it, so is there a way to execute Error Hooks say Default On Error in Passive Mode?
Eddie Hartman
2017-03-19 20:22:28 UTC
Permalink
Raw Message
Post by Sufyan Khan
Post by Eddie Hartman
Post by Sufyan Khan
I am using HTTP Client Connector in Passive Mode, to get Hooks executed I am using HTTPConnector.callreply(Entry) api instead of HTTPConnector.connector.queryReply(Entry), so just want to know what all hooks of the connector would be executed.
You can open the Hooks tab with the Connector in this mode and see what happens under the CallReply branch: so Output Map, Before CallReply, After CallReply and Input Map.
Actually I have to make an HTTP call 4~5 times so instead of using 4~5 connectors I am using 1 connector in Passive mode and from script I am setting params and executing it, so is there a way to execute Error Hooks say Default On Error in Passive Mode?
If you executing AL Connector methods then you should be able to code the Hooks. I always call the Connector Interface methods - i.e. thisConnector.connector.queryReply() for the HTTP Client Connector. In this case I have to wrap the call in a try-catch block to deal with exceptions.

try {
returnEntry = httpCI.queryReply(sendEntry);
} catch (ex) {
task.logmsg("ERROR", "Error making HTTP call: " + ex + "\nSend Entry: " + sendEntry.toJSON());
}

Note that I often write out Entry objects in JSON format so that I can write ALs that monitor and analyze log output.
Sufyan Khan
2017-03-20 12:01:29 UTC
Permalink
Raw Message
Post by Eddie Hartman
Post by Sufyan Khan
Post by Eddie Hartman
Post by Sufyan Khan
I am using HTTP Client Connector in Passive Mode, to get Hooks executed I am using HTTPConnector.callreply(Entry) api instead of HTTPConnector.connector.queryReply(Entry), so just want to know what all hooks of the connector would be executed.
You can open the Hooks tab with the Connector in this mode and see what happens under the CallReply branch: so Output Map, Before CallReply, After CallReply and Input Map.
Actually I have to make an HTTP call 4~5 times so instead of using 4~5 connectors I am using 1 connector in Passive mode and from script I am setting params and executing it, so is there a way to execute Error Hooks say Default On Error in Passive Mode?
If you executing AL Connector methods then you should be able to code the Hooks. I always call the Connector Interface methods - i.e. thisConnector.connector.queryReply() for the HTTP Client Connector. In this case I have to wrap the call in a try-catch block to deal with exceptions.
try {
returnEntry = httpCI.queryReply(sendEntry);
} catch (ex) {
task.logmsg("ERROR", "Error making HTTP call: " + ex + "\nSend Entry: " + sendEntry.toJSON());
}
Note that I often write out Entry objects in JSON format so that I can write ALs that monitor and analyze log output.
Hello Eddie,

Thanks for your response.

Coding hooks you meant implementing TDI Hooks APIs (not sure if exist), if yes any reference link or doc would be helpful as I had never done that before.

Yes I was doing the same, using queryReply api wrapped with try-catch for any exceptions.

For analysis and monitoring - if code snippet is handy could you please show me a bit like how you are doing?


Regards,
Sufyan
Eddie Hartman
2017-03-20 21:25:56 UTC
Permalink
Raw Message
Post by Sufyan Khan
Post by Eddie Hartman
Post by Sufyan Khan
Post by Eddie Hartman
Post by Sufyan Khan
I am using HTTP Client Connector in Passive Mode, to get Hooks executed I am using HTTPConnector.callreply(Entry) api instead of HTTPConnector.connector.queryReply(Entry), so just want to know what all hooks of the connector would be executed.
You can open the Hooks tab with the Connector in this mode and see what happens under the CallReply branch: so Output Map, Before CallReply, After CallReply and Input Map.
Actually I have to make an HTTP call 4~5 times so instead of using 4~5 connectors I am using 1 connector in Passive mode and from script I am setting params and executing it, so is there a way to execute Error Hooks say Default On Error in Passive Mode?
If you executing AL Connector methods then you should be able to code the Hooks. I always call the Connector Interface methods - i.e. thisConnector.connector.queryReply() for the HTTP Client Connector. In this case I have to wrap the call in a try-catch block to deal with exceptions.
try {
returnEntry = httpCI.queryReply(sendEntry);
} catch (ex) {
task.logmsg("ERROR", "Error making HTTP call: " + ex + "\nSend Entry: " + sendEntry.toJSON());
}
Note that I often write out Entry objects in JSON format so that I can write ALs that monitor and analyze log output.
Hello Eddie,
Thanks for your response.
Coding hooks you meant implementing TDI Hooks APIs (not sure if exist), if yes any reference link or doc would be helpful as I had never done that before.
Yes I was doing the same, using queryReply api wrapped with try-catch for any exceptions.
For analysis and monitoring - if code snippet is handy could you please show me a bit like how you are doing?
Regards,
Sufyan
If you have not done so yet, I suggest you work through the TDI tutorials in the Getting Started guide. You'll find the link at the top of http://tdi-users.org, along with videos and HowTo write-ups.
Loading...