An Israeli soldier and a bystander were wounded in a West Bank shooting attack before the alleged assailant was shot dead, the army said in a statement.