SEATTLE — The first retail shops selling legal recreational marijuana in Washington State are preparing to open next month. Cash registers are standing by, and the first crops are almost ready for harvesting. But not every part of the state is joining the party.

The state attorney general, in a nonbinding legal opinion, has said local governments can regulate marijuana under the statute legalizing its recreational use, and at least 10 cities and counties in Washington have gone even further, banning marijuana businesses outright. An additional 69 municipalities, and 12 counties, have voted for moratoriums on such businesses, according to the Municipal Research and Services Center, a nonprofit group in Seattle that works with local governments on multiple issues.

Now, a lawsuit brought by a man who was denied a license to sell marijuana in Wenatchee in central Washington’s apple-growing country is challenging the rights of local governments to ban marijuana businesses — and also raising the possibility that the state’s marijuana law will come under sharp legal scrutiny.

The plaintiff, Shaun Preder, has been told by the city that he will not get a local business license to sell marijuana because the drug remains illegal under federal law — and that all Wenatchee businesses must comply with federal law.