It is said that laws reflect current morals and that laws cannot influence morals. I imagine that it is rather difficult to find more than anecdotal data to test such a hypothesis.
Niklas Jakobsson and Andreas Kotsadam claim to have found the right natural experiment. In January 2009, buying sex became a criminal offense in Norway. The explicit goal of the law was to change the attitude of the people towards buying sex. Looking at Norway and Sweden (where there was no such change on law), they find that attitudes did not change more in Norway than in Sweden, if anything, people become a little more liberal. Save for one case: Oslo. There, prostitution is more visible, thus people were more aware of it and responded the way the lawmakers wanted.
The analysis is based on survey data. It would be interesting to know whether the actual purchases of sexual services were also affected. Indeed, it does not matter much if someone who would not buy sex anyway now has a negative attitude towards it. The paper clearly shows that people who are not close to the problem are not affected. Those that are at the margin of changing a decision are those you would want to affect. And only market data can reveal their choices.