Both the Senate and a U.S. District Court judge suggested yesterday that President Carter had exceeded his authority by unilaterally announcing termination of the mutual defense treaty with the Republic of China on Taiwan.

In a sharp but strictly sympolic rebuff to the president, the Senate overwhelmingly voted for a "sense of the Senate" resolution declaring that "approval of the Senate is required to terminate any mutual defense treaty between the United States and another nation."

Earlier in the day, U.S. District Court Judge Oliver Gasch said in a ruling from the bench that the power to terminate treaties "is a power shared by . . . the president and Congress."

Gasch dismissed a suit challenging the legality of Carter's announcement that the treaty would be terminated, saying that members of Congress who filed the suit lacked proper legal "standing" because Congress had not expressed an opinion on Carter's right to terminate the Taiwan treaty.

However, last night's Senate vote could be interpreted as just such an expression of opinion. Sen. Barry Goldwater (R-Ariz.), principal plaintiff in the suit before Judge Gasch, announced last night that he would ask the judge to reconsider his dismissal of the case at once.

In his opinion earlier, Judge Gasch said that if the Senate "takes action the result of which fails short of approving proving the president's termination effort, then the controversy will be ripe for a judicial declaration respecting the president's authority to act unilaterally."

The Senate bogged down last night in parlimentary wrangling following its suprising 59-to-35 vote to substitute a brief, stark motion by Sen Harry F. Byrd Jr. (Ind-Va.) for an elaborate resolution on treaty termination worked out by the Foreign Relations Committee after extensive hearings and cunsultations with legal scholars.

Final action was postponed until next week.

But even before final action on the symbolic "sense of the Senate" resolution, it appeared clear that senators welcomed the opportunity to claim a role for themselves in the abrogation of mutual defense treaties. President Carter's announcement that the treaty with Taiwan would be terminated apparently is the first such case in the history of the United States. The Senate has been unhappy since it was announced that Carter took the step unilaterally and without consultations.

The Senate action, even if later confirmed in a final vote, has no practical effect on the president's termination of the Taiwan treaty or his recognition of the People's Republic of China.As Sen. Harry Byrd said in yesterday's debate, he can ignore a sense of the Senate resulation if he wants to.

If Judge Gasch later agrees to hear the Goldwater suit, however, that could have a practical effect on the president's action. Goldwater said repeatedly yesterday, however, that he did not expect the suit to alter the new status quo in the Far East by changing the decision to recognize Peking.

In his 12-page opinion, Gasch said he "believes the power to terminate treaties is a power shared by the political branches of this government, namely, the president and the Congress."

But the judge said that the suit, brought last December by Goldwater, seven other senators, a former senator and 16 House members, was premature because Congress still had a chance to act on the treaty termination.

Gasch said that in the absence of "any injury to the institution [Congress] as a whole, the individual legislators" could not claim that they were wronged by Carter's termination of the treaty.

The judge did not decide whether the Carter administration adequately consulted with Congress before abrogating the Taiwan treaty because the final language of the International Security Assistance Act of 1978 said only that the administration "should" consult with Congress before making any change in the treaty, not that it "shall" consult.