When a material witness for the defendant resides out of the state the defendant may apply for an order that the witness be examined on a commission to be issued under the seal of the court, and the signature of the clerk, directed to some party designated as commissioner, authorizing him to examine the witness upon oath or interrogatories annexed thereto, and to take and certify the deposition of the witness and return it according to the instructions given with the commission.
R.L.1910, § 6037.