09-08-2011, 06:19 AM
More XML Gateway questions.
*** Serial Numbers
The command to retrieve event information has a serial number, so CQC can return information only about events which have changed. Does the serial number persist across multiple connection sessions? It looks like it does, but I wanted to make sure, so that after reconnection I can still send the most recent serial number I have, rather than having to send a 0 again and reload the data.
I was also noticing last night that the serial number seemed to change without any actual difference in the events. I saw two successive serial numbers where the event data was character-for-character identical. Any idea why that would happen?
*** Disconnects
Right now, my XML Gateway client stays connected until it gets the disconnect message from the server after a minute of the user not needing any more information, at which point the client disconnects (since the server does so anyway). It sounds, though, like this might cause an error message in the server log, meaning that maybe you don't expect clients to behave that way. Am I supposed to proactively disconnect after a certain period of time? To disconnect, do I just close the connection, or am I supposed to send some sort of message?
*** Macro Parameters
When I send a blank parameter, either via <CQCGW:MacroParm></CQCGW:MacroParm> or via <CQCGW:MacroParm />, I get an exception:
<CQCGW:ExceptionReply CQCGW:ErrClass="EClass_BadParms" CQCGW:ErrSev="ESev_Failed" CQCGW:File="CIDXML_SimpleTree.cpp" CQCGW:Line="957" CQCGW
rocess="CQCGWSrv" CQCGW:Thread="CQCGWSrvWorkerThread0">
Got a child index of 0 but only 0 exist in this CQCGW:MacroParm element
</CQCGW:ExceptionReply>
When I send a parameter consisting of a single space character, it does not give me that exception. So should I always convert blank parameters into single spaces?
The server behaves somewhat sullenly when I try to send non-numeric data for a numeric parameter. I have a test macro that takes a single integer parameter. When I send "1asdf" as the parameter value, I get back an UnknownExceptionReply message, and then the server disconnects. Swift and exacting justice! Since there is no way for me to know that I need to validate the parameter as an integer, it's difficult for my program to avoid this fate.
*** Field Values
I noticed an amusing quirk. I wrote "034" to an integer field, and when I read the value back, it was 28. I eventually realized that you must be using scanf or something like that which accepts octal numbers with a leading 0. I didn't check, but would that also work with 0x for hex? Is this documented behavior? Does it apply to macro parameters as well as field values?
*** Global Actions
I was talking to Commander Vimes about global actions. He thinks it would be useful for my client to allow him to execute them. But am I right that there's no list of available global actions the same way there is for macros? Are there any guidelines for correct syntax of the global action string?
*** Serial Numbers
The command to retrieve event information has a serial number, so CQC can return information only about events which have changed. Does the serial number persist across multiple connection sessions? It looks like it does, but I wanted to make sure, so that after reconnection I can still send the most recent serial number I have, rather than having to send a 0 again and reload the data.
I was also noticing last night that the serial number seemed to change without any actual difference in the events. I saw two successive serial numbers where the event data was character-for-character identical. Any idea why that would happen?
*** Disconnects
Right now, my XML Gateway client stays connected until it gets the disconnect message from the server after a minute of the user not needing any more information, at which point the client disconnects (since the server does so anyway). It sounds, though, like this might cause an error message in the server log, meaning that maybe you don't expect clients to behave that way. Am I supposed to proactively disconnect after a certain period of time? To disconnect, do I just close the connection, or am I supposed to send some sort of message?
*** Macro Parameters
When I send a blank parameter, either via <CQCGW:MacroParm></CQCGW:MacroParm> or via <CQCGW:MacroParm />, I get an exception:
<CQCGW:ExceptionReply CQCGW:ErrClass="EClass_BadParms" CQCGW:ErrSev="ESev_Failed" CQCGW:File="CIDXML_SimpleTree.cpp" CQCGW:Line="957" CQCGW

Got a child index of 0 but only 0 exist in this CQCGW:MacroParm element
</CQCGW:ExceptionReply>
When I send a parameter consisting of a single space character, it does not give me that exception. So should I always convert blank parameters into single spaces?
The server behaves somewhat sullenly when I try to send non-numeric data for a numeric parameter. I have a test macro that takes a single integer parameter. When I send "1asdf" as the parameter value, I get back an UnknownExceptionReply message, and then the server disconnects. Swift and exacting justice! Since there is no way for me to know that I need to validate the parameter as an integer, it's difficult for my program to avoid this fate.
*** Field Values
I noticed an amusing quirk. I wrote "034" to an integer field, and when I read the value back, it was 28. I eventually realized that you must be using scanf or something like that which accepts octal numbers with a leading 0. I didn't check, but would that also work with 0x for hex? Is this documented behavior? Does it apply to macro parameters as well as field values?
*** Global Actions
I was talking to Commander Vimes about global actions. He thinks it would be useful for my client to allow him to execute them. But am I right that there's no list of available global actions the same way there is for macros? Are there any guidelines for correct syntax of the global action string?