BEIJING — China named the Communist Party's No. 2 leader, Li Keqiang, premier on Friday as a long-orchestrated leadership transition nears its end, leaving the new leaders to confront uneven economic growth, unbridled corruption and a severely befouled environment that are stirring public discontent. The rubber-stamp legislature endorsed Li for the post, voting 2,940 in favor with one opposed and six abstaining. A day earlier, the legislature similarly appointed Xi Jinping to the ceremonial post of president, making him China's pre-eminent leader following his ascent last November to head the Communist Party and the military. Though the outcome of the legislative session was a foregone conclusion, it's the result of years of fractious behind-the-scenes bargaining. They hail from different factions: Li Keqiang (pronounced lee kuh chahng) is a protege of the now-retired President Hu Jintao while Xi Jinping (pronounced shee jin ping) is the son of a revolutionary veteran with backing among party elders. After Li's selection was announced, he and Xi shook hands and smiled for photographers in the Great Hall of the People. Evidence of their and their patrons' ability to forge consensus will be seen Saturday when appointments to the Cabinet and other top government posts are announced. Together, Xi and Li now steer a rising global power beset with many domestic challenges that will test their leadership. Chief among them are a sputtering economy that's overly dominated by powerful state industries. Chinese leaders want to nurture self-sustaining growth based on domestic consumption and reducing reliance on exports and investment. Consumer spending is rising, but not as fast as Beijing wants, which has forced the government to support an economic recovery with spending on public works and investment by state companies. “If the official data is to be believed, China has been moving in the wrong direction for the past decade — towards ‘more investment, less consumption,'” wrote Standard Chartered economists Stephen Green and Wei Li in a research note. “This could create problems.” An increasingly vocal Chinese public is expressing impatience with the government's unfulfilled promises to curb abuses of power by local officials, better police the food supply and clean up the country's polluted rivers, air and soil. In some intriguing signs of the new leadership's direction, the congress on Friday appointed as supreme court President Zhou Qiang, a provincial party secretary with a reputation as a progressive. On Thursday, another liberal-minded reformer and a close ally of Hu, Li Yuanchao, was named vice president. — Agencies