He met the composer Joseph Haydn and the two men became great friends , often playing together in a string quartet . Mozart met Joseph Haydn in Vienna , and the two composers became friends ( see Haydn and Mozart ) . When Haydn visited Vienna , they sometimes played together in an impromptu string quartet .