Starbucks in Beijing
Tourists pose for photographs outside a Starbucks outlet inside the Forbidden City in Beijing. REUTERS/Claro Cortes IV

From International Business Machines Corp. (NYSE:IBM) to Starbucks Corporation (NASDAQ:SBUX), China hasn’t been making life easy for foreign companies in the past year. While these companies probably cannot afford to ignore the world’s single largest market, the hurdles from the Chinese government are certainly making them less than eager to do business there.

“The operating environment for foreign firms has deteriorated in the last year in a serious way,” said Shaun Rein, managing director of China Market Research Group in Shanghai, according to Bloomberg. “In my 16 years in China, it’s some of the worst business sentiment among foreign executives. They don’t feel as welcome as they used to.”

Last week, China’s state-controlled television network caused online uproar by broadcasting a program accusing Starbucks of charging too much. The network also said Samsung Electronics Co. Ltd. (KRX:005930)’s smartphones don’t work properly. IBM’s China revenue slipped 22 percent in the third quarter, as China’s state-owned enterprises began delaying orders, including mainframes and servers necessary for IBM’s production.

China was once the world’s workshop, but its appeal is slipping fast. According to a survey from the U.S.-China Business Council, a D.C.-based trade group, almost 70 percent of the more than 100 American firms polled said profit margins from China would be flat or narrow this year, citing rising costs and bureaucratic red tape. Only 39 percent are optimistic about the next five years in China, down from the 58 percent who were optimistic in 2011, Bloomberg reported Sunday.

And the trouble that the government makes for the foreign companies is only the start of it – slowing growth has hit the Coca-Cola Company (NYSE:KO), Nike Inc (NYSE:NKE), McDonald’s Corporation (NYSE:MCD), and Yum! Brands Inc. (NYSE:YUM)’s KFC and Pizza Hut.

Part of the problem is the national economic slowdown. China is projecting this decade’s economic growth at an average of 7 percent, compared to the 10.5 percent in the previous decade. There is also the housing bubble and a five-year credit expansion that saw a sharp increase in the nation’s debt. As a result, wages have tripled in the past decade.

Chinese consumers tend to revert to local chains in such difficult economic times, and shy away from foreign brands, said Don Thompson, the CEO of McDonald’s.

Even so, China is a huge piece of the global market that no company can ignore, and it will become an even larger one as the Chinese middle class doubles to 600 million in the next decade, according to the U.S.-China Business Council. Doing well in China could often mean doing well, period.

On the plus side, General Electric Company (NYSE:GE) boosted sales 13 percent in China in the third quarter owing to a surge of demand in health care devices, and Coach Inc. (NYSE:COH) saw a 35 percent increase in sales in China even as its American business sagged. And General Motors Company (NYSE:GM) and Volkswagen AG (ETR:VOW) each plan to sell 3 million vehicles in China this year, Bloomberg reported.