With North Korea, as with other foreign policy challenges, Mr. Trump has tended to personalize the issue, emphasizing his rapport with leaders and his ability to strike deals.

The question is whether he will have better luck with Mr. Moon than he has had with Mr. Xi.

“This is going to be a more difficult relationship than we’ve had for a few years,” said Jeffrey A. Bader, a top Asia adviser to President Barack Obama. Mr. Moon, he predicted, would seek to restore trade with the North, and visit Pyongyang during his five-year term.

But, Mr. Bader added, “at the outset, he wants a good relationship with Trump.”

The White House clearly wants the same. The two-day visit, officials said, would include ceremonies, like a wreath-laying and a visit to the Korean War Veterans Memorial, that are intended to celebrate the alliance between the United States and South Korea.

Officials said they were encouraged by an interview with Mr. Moon in The Washington Post last week, in which he said he would not necessarily cancel the deployment of the antimissile system, known as the Terminal High-Altitude Air Defense, or Thaad. South Korea, he said, was conducting an environmental impact assessment on it.

The Trump administration, one senior official said, wants to avoid being interposed between the South and the North, which happened during previous periods when Washington and Seoul clashed over how to deal with the North Korean government.

For some in the White House, Mr. Moon’s election was a political sea change in South Korea — a victory, particularly for young voters, who want a different kind of relationship with their northern neighbor. Some have even taken to calling it South Korea’s “Brexit.”

Popular sentiment in South Korea toward China has deteriorated in recent years, and Mr. Moon’s government is also likely to have a chilly relationship with Japan. That could complicate efforts by the Trump administration to coordinate regional pressure against the North.