I'm fully expecting there to already exist a better way - in which
case I'd be pleased to be informed :)
It's not necessarily a better way, but I have a perl module that
does something like this (I dump request, reply and check). But,
thanks for sharing..