Subs Harmonizers: interop report
I see on Scripting News today that there a couple more subsHarmonizer implementations have popped up, so thought I'd run my test suite over them to see how they go. Neither seem to behave the same way as mine and Dave's, although looking back at the spec, their behaviour may actually be correct. The way I implemented mine was to look at Dave's Radio client code, do the same thing in Python, verify that it worked with Dave's server, then write the server-side code so that it worked with mine too. However, the resulting code didn't conform to the spec (it only accepted strings where the spec says arrays are required, for subscribe() and unsubscribe() - now fixed).
Treating Dave's server responses as the correct ones, here are the results. Everyone appears to conform to the spec, but there are differences in things that aren't stated specifically.
| server | invalid login | unknown method | startup() -> array | subscribe (string) (opt.) | unsub. (string) (opt.) | setup / subscribe (array) | unsub. (array) | reset() (opt.) |
| harvard | fault 4 | fault 7 | yes | yes | yes | yes | yes | fault 7 |
| topicex. | fault 4 | fault 7 | yes | yes | yes | yes | yes | yes |
| miseldine | empty string | fault 0 | yes | fault 0 | fault 0 | yes | yes | yes |
| ghostc. | fault 1 | blank HTTP response | yes | yes | no | yes | yes | blank HTTP response |
In light of all this, here are some recommendations for implementors. First, people doing the server side:
- XML-RPC fault code 4 should be returned when invalid login details are passed.
- XML-RPC fault code 7 should be returned on an invalid method.
- String values should be accepted where arrays are specified in the spec (i.e. subscribe(login, password, url) should be equivalent to subscribe(login, password, [url]))
And for clients:
- Always pass urls as arrays (Dave's and my implementations allow strings in subscribe and unsubscribe, but others don't).