What happens when C17H35COO-, a soap, reacts with an acidic solution?
Your equation is correct. Hydrochloric acid ($\ce{HCl}$) is a stronger acid than stearic acid ($\ce{C17H35COOH}$),i.e. it is dissociated into $\ce{H+}$ and $\ce{X-}$, the anionic rest, to a greater degree. Therefore, it protonates the stearate ion. One can also say that the conjugated base of stearic acid (the stearate ion) is a stronger base than chloride, the conjugated base of hydrochloric acid.