WASHINGTON — PRESIDENT Clinton's visit in January with US troops in Bosnia-Herzegovina and his first face-to-face encounter with service members aboard an aircraft carrier two months after taking office provide a study in contrasts.
The former was an upbeat affair, with smiling GIs at the US headquarters in Tuzla eager to shake the hand of their commander in chief. The latter was an embarrassment, as sailors on the USS Theodore Roosevelt, irate over his plan to end the ban on homosexuals in the military, openly derided Mr. Clinton.
To many experts, the dramatic difference in receptions underscores the success Clinton has achieved in an effort to overcome the disdain and dislike many in the military felt for him at the beginning of his term.
The improved relations probably will not mean more votes for the president in November as the services and veterans remain bedrocks of conservatism. But, experts say, Clinton is now less susceptible to the sort of damaging attack that Sen. Jesse Helms (R) of North Carolina unleashed last year when he averred that the president was unqualified to command the nation's armed forces.
''There may not be the measure of affection for this president as there was for Ronald Reagan. But there is now a measure of respect,'' says Andrew Krepinovich, a former army colonel who heads the Center for Strategic and Budgetary Assessment, a Washington think tank.
Says a senior officer, who requested anonymity: ''Bill Clinton has made a very careful, concerted effort to recover from the dismal first 10 months. Whether it was insight or wisdom or political expediency, he realized that he needed to reconcile his relationship with the military, and he's gone to great extremes to do that.''
Not everyone agrees. Sen. John McCain (R) of Arizona, a former pilot and prisoner of war in North Vietnam, says he heard nothing complimentary about Clinton from US troops during his own visit to Bosnia this month.
''These young men and women respect President Clinton, as they should. But there was no affection. They don't have a real high opinion of him,'' Senator McCain asserts. ''They were just not happy about being sent to Bosnia, and they were not happy about being sent to Haiti. They don't see how our vital national interests were involved.''
Asked to name Clinton's greatest liability with the troops, McCain replies: ''The way he didn't serve.''
Indeed, Clinton's credentials on taking office didn't endear him to many past and present military members. He was not a veteran, he avoided the Vietnam draft, and he protested the war. The disdain burst into the open shortly after he took office when the White House began moving on Clinton's campaign pledge to end the ban on homosexuals in the military.
Objections surfaced throughout the ranks, including the Joint Chiefs of Staff. Gone was even a brief honeymoon. To some in the military, Clinton's failure to seek its opinion on the issue was as galling as the plan itself.
''The White House ... kicked off its relationship with the military with this tremendous arrogance,'' says the senior officer. He adds that anger at ''arrogant,'' young White House aides grew when a top Army commander, Gen. Barry McCaffery, was snubbed by a presidential aide during a visit to the White House.
Realizing he was alienating one of the most important branches of his own government, Clinton went into damage control, says Andrew Basevich, a civil-military affairs expert at Johns Hopkins University in Washington. ''I suspect that after the fiasco of the gay issue, he [Clinton] said that it was too politically damaging for him to pick fights with the uniformed military.''
Clinton dropped the idea to end the ban and accepted a policy known as ''don't ask, don't tell.'' It bars inquiries about service members' sexual orientations and permits them to keep their preferences secret. But it allows discharges if service members who declare their orientations fail to prove they will not engage in homosexual acts.
Clinton took another step toward reconciliation when he opened his State of the Union address last month by thanking ''our men and women in uniform.'' Such tributes, and visits to troops in Germany and Bosnia, are point-gainers and morale-boosters, experts say.
''This is tremendously important to soldiers as they see it as recognition by the nation that what they are doing is worthwhile,'' notes David Segal of the Center for Research on Military Organization at the University of Maryland.
CLINTON also used the speech to atone for the slight to General McCaffery, naming the US Southern Command chief as the new head of White House drug policy.
Clinton, experts say, has gone beyond the superficial. He has accepted a fiscal 1996 Pentagon budget that is $7 billion higher than he requested and contains a 2.4 percent increase in military salaries.
In its budget proposal last year, the administration emphasized bolstering the readiness of US forces. It also advocated quality-of-life improvements for military families, including building new housing with private-sector participation.
On another front, the administration scaled back a fourth and final round of military-base closures. This action is sure to help placate a military already reeling from massive downsizing.
Clinton has also benefited, experts say, from his decision to withdraw from the disastrous UN mission in Somalia, the smooth operation in Haiti, and the relatively successful deployment in Bosnia. What was most important in each case, experts say, is that he sought the counsel of the top brass.
The president's willingness to listen is especially evident in Bosnia. Heeding deep Pentagon reservations, Clinton decreed strict rules of engagement for the US-led NATO force, a one-year time frame, and a defined exit strategy. But, says Mr. Krepinovich, the goodwill could evaporate if ''things in Bosnia go sour and the president was not able to defend his policy ably.''
Another factor that has helped Clinton is his defense secretary, William Perry. Experts say Mr. Perry is esteemed by the military as a highly capable advocate of its interests both with the White House and on Capitol Hill.