The defendant in any criminal prosecution may take the testimony of any convict in the penitentiary on interrogatories and notice as in other cases of taking testimony by interrogatories, the convict's answer being taken on oath and returned with the commission as in other cases, but the notice in such case, with a copy of the interrogatories, must be served on the district attorney of the circuit in which the prosecution is pending.