The corporation commission, and the several members thereof, shall have power to inspect and investigate the property, books, papers, business, methods, and affairs of any corporation whose stock shall be offered for sale to the public and of any public service corporation doing business within the state, and for the purpose of the commission, and of the several members thereof, shall have the power of a court of general jurisdiction to enforce the attendance of witnesses and the production of evidence by subpoena, attachment, and punishment, which said power shall extend throughout the state. Said commission shall have power to take testimony under commission or deposition either within or without the state.