Caspar Willard Weinberger in his seven years as secretary of defense was the indefatigable lawyer for his client, President Reagan, and all his causes; the unflagging champion of the military services and their budgets, and the uncooperative witness before a Congress searching for a middle ground on the question of how much was enough for national defense.

Almost whatever Reagan wanted -- an antimissile umbrella, a rebirth of the B1 bomber, a different way to deploy the MX missile -- Cap, the former corporate lawyer, would try his damnedest to get, whether the jury be congressional committees, foreign leaders, the American public or the press. He argued every case with such vigor that it was difficult for even his associates in the Pentagon to tell whether he believed everything he was saying or was just being the good lawyer for Reagan.

Weinberger did seem to have an innate, passionate distrust of the Soviets that made it easy for him to champion high defense budgets and specific programs -- like the Strategic Defense Initiative missile shield -- despite warnings that military spending must be cut to reduce the federal deficit threatening all government activities, including the rearmament program.

But that same distrust made it difficult for him to support arms control pacts with Moscow, even when it was clear Reagan wanted them. This was the only visible gap between Weinberger and Reagan, whose relationship some of his associates compared to that between the late President John F. Kennedy and his brother, Bobby. Alexander M. Haig Jr., when he was Reagan's secretary of state, complained that this special relationship sometimes froze him out.

What Weinberger did as the steward of the biggest military buildup of all time was to prove himself a masterful fund-raiser, reflected by the fact that military spending jumped from $180.7 billion in fiscal 1982 to $274 billion in fiscal 1987.

What he did not do, according to his critics in the Pentagon and Congress, was to ride herd on the military services to ensure that all the mountain of money Congress appropriated was spent wisely.

Procurement scandals, symbolized by a $640 Navy toilet seat and $7,400 Air Force coffee brewer, made it easier for lawmakers to cut Reagan's defense budget in his second term.

Weinberger's cancellation of the Army's trouble-plagued Sergeant York antiaircraft gun was a rare exception.

The rule was buy, buy, buy -- even after Congress balked at making annual military budget increases. The big bills for hardware ordered early in the Reagan buildup will come due over the next decade. Weinberger's likely successor, Frank C. Carlucci, confronts military blueprints that may be too expensive to implement.

One new estimate making government rounds is that by the year 2000, the Pentagon will have $2 trillion less than needed to finance the rest of the military buildup now planned, even if Congress reverses course and raises the defense budget 3 percent annually. A Pentagon study commission organized by Undersecretary of Defense Fred C. Ikle was so appalled to learn this that it left the estimate out and did not address its implications, congressional sources said.

Reagan and Weinberger blasted former president Jimmy Carter and his defense secretary, Harold Brown, for letting American defenses sag in the late 1970s, which Weinberger called "the decade of neglect." For the most part, however, the Reagan administration only expanded the Carter-Brown program it inherited. Exceptions were the resurrection of the B1 bomber and acceleration of antimissile research under the banner of SDI. "It was the Carter program put on speed," said one Pentagon careerist.

The centerpiece of Carter's and Reagan's strategic offense was the MX silo-busting missile. It took Carter years to finally persuade Congress to deploy 200 mobile MXs on the valley floors of Nevada and Utah. Reagan in his 1980 presidential campaign ridiculed this deployment scheme and vowed to come up with something better.

But his MX deployment schemes ran into even more ridicule than Carter's. Today, Reagan can count only on getting 50 MX missiles deployed, if that many, in existing Minuteman silos. The U.S. nuclear deterrent of 1987 is basically the one Reagan inherited, a combination of Minuteman land missiles, Poseidon and Trident submarine missiles and cruise missiles that can be launched from bombers beyond Soviet defenses. The B1 bomber is the only new platform.

Perhaps Weinberger's biggest accomplishment as chief executive officer of the world's biggest defense corporation was in getting raises for military men and women and raising their pride in wearing the uniform. The All Volunteer Force, started after the draft was suspended in 1972, has been a big success during Weinberger's years. He also has warmed hearts of the brass by assailing civilians of past administrations for not allowing the military to win the Vietnam war.

Weinberger turned out to be the wise old head in opposing the dispatch of Marines to Lebanon and the covert scheme to sell U.S. arms to Iran and divert the proceeds to the contras fighting Nicaraguan government forces. His voice, according to those who heard it during secret deliberations on risky military operations, was the one of reason when it came to undertaking operations such as the unsuccessful bombing of Lebanon in 1983 and the comparatively successful 1986 raid against Libya. He favored the invasion of Grenada in 1983 and has consistently argued that the United States must keep the Persian Gulf open to international shipping.

In weathering the storms of controversy over the last seven years, Weinberger never lost his sense of humor or cordiality to foes and friends alike, and yet he was far from a back-slapping pol.

"Cap was the man born in the suit," said one of his former deputies. "But this is one guy who never gives up."