2 soldiers, 4 militants killed in J&K attack