Measurement of the electron density and magnetic field of the solar wind using millisecond pulsars