The judge shall allow to sheriffs, referees, receivers, and witnesses such compensation as is allowed for like service in other cases, to be taxed as costs in the case, and shall enforce by order the collection thereof from such party or parties as ought to pay the same.