The act of artificially stimulating the body to develop antibodies against infectious disease by the administration of vaccines or toxoids.