The "world's oldest profession" is still a major target for the law. Prostitution stings occur often nowadays, with police officers posing as prostitutes who offer sexual favors in exchange for money. It can be as simple as that. These stings have also become so elaborate that some police precincts have purchased homes for the sole purpose of conducting their prostitution stings.
In the technological world we live in now, a police officer can catch a "john" by simply placing an ad online. You can add massage parlors to the list of places and businesses that the police target. It's not only adult websites and "escort service" publications that catch the law enforcement's eye.
Just as taboo subjects like gay marriage and marijuana seem to be headed towards nationwide legalization in the not too distant future, perhaps one day prostitution will be legal as well. But until that time comes, you will need an experienced criminal defense attorney if you are caught soliciting a prostitute or if you are a working as a prostitute. The best defense can keep you out of jail and hopefully keep you off a mandatory sex offender registration. The term "entrapment" is used often in defense of solicitation charges. It's very helpful only if the police officer(s) aggressively entices the suspect to commit the crime. Two other defenses that should be considered are "due process" and "lack of probable cause".
Getting caught in a sting for prostitution can be an embarrassing ordeal, especially if the person arrested has a family. Being arrested doesn't equal guilt, but not having the best defense attorney by your side hurts chances at victory and justice.