Terrorist shot and wounded trying to stab soldier