Serialization of the invoke response/packet header. Tests.