The invention relates to a vaccine, preferably administered via mucous membranes, for controlling diseases caused by infectious agents that use heparan sulphate (HS) as a cell receptor. The vaccine consists of an immunogenic formulation for veterinary use, which comprises an antigen of which the cell receptor is heparan sulphate (HS), and a vehicle of oral, intranasal or parenteral administration. The vehicle is biopolymers of D-glucosamine and N-acetyl-D-glucosamine functionalised with sulphur atoms, and/or a biopolymer of chitosan functionalised with sulphur atoms; and the antigen is microencapsulated by said types of functionalised biopolymers.