The chancery court shall have power to issue a summons for any person, or subpoena for any witness, whose appearance in court may be deemed necessary for any purpose, whether such party or witness reside in the same or any other county. It shall be the duty of the party summoned or subpoenaed, to attend the court according to the command of the process; and if it be necessary or proper to enforce the appearance of the party, the court, on the return of the process executed and failure to appear, may issue an attachment, and may fine the party when brought in for a contempt. If a witness before the court shall refuse to testify, the court may commit such witness for contempt of the court.