The Security Council tonight heard a seemingly unending stream of countries from every corner of the world brand Iran's holding of U.S. diplomats as a violation of international law and call for the release of hostages.

They spoke against a background of Iran's continuing boycott of the council debate. But the solid front being presented by U.N. members on the hostage issue still gave rise to guarded, but reviving hope that the world bodyd might yet succeed in nudging Iran toward mediation of its dispute with United States.

By the end of tonight's second session of public debate, 29 countries, among them all 15 members of the Security Council had gone on record as insisting that the 50 American hostages in Tehran be freed on both legal and humanitarian grounds.

They included not only most of America's traditional allies in the Western alliance but also the communist Soviet and Chinese superpowers and several Third World countries.

Of those who spoke tonight, some like West Germany angrily characterized Iran's action as "a flagrant violation of international law . . . compounded by contempt for elementary humanitarian considerations." Others like Kuwait, a Persian Gulf country uneasy about the possible spread of the radical, religious-inspired stirrings in neighboring Iran, spoke sympathetically of the "legitimate frustrations and grievances of the Iranian people" and cautioned against inflaming them further through resort to drastic action.

But, on the central issue -- the plight of the hostages -- there was an almost metronome-like monotony to the unanimity of opinion that they must be freed.

By the time the debate ends, probably on Monday or Tuesday, the expectation is that Iran will be unmistakably on notice that it has no support among the world's governments for its use of force and that its only hope for redress lies in freeing the hostages and scaling down its demands for the forced return of Shah Mohammad Reza Pahlavi from the United States.

That, U.N. members clearly hoped, might spark a revival of Secretary General Kurt Waldheim's currently sidetracked efforts to work out a three-part deal -- release of the hostages in exchange for Iran's having the opportunity to state its grievances before the world body and appointment of an international commission to investigate the shah's alleged crimes.

Tacit encouragement for this was given by U.S. Ambassador Donald McHenry, whose carefully worded statement to the Council last night balanced a warning that release of the hostages is 'not negotiable" with a renewed U.S. offer to discuss Iranian grievances after the captives are freed.

McHenry said today that he expects the debate to end with a resolution or other action adopted unaminously by the Council. He added, however: "We are not seeking a resolution of condemnation. We want the council to consider a resolution that will contain the elements of a solution."

These same carrot-and-stick themes -- a call for release of the hostages coupled with promises of a full and sympathetic hearing for Iran -- were sounded by almost every other country that spoke last night, and those nations waiting to make statements are expected to keep stressing those points throughout the remainder of the debate.

Whether the message will make an impact on Ayatollah Ruhollah Kohomeini and Iran's other revolutionary leaders is still far from clear. The continuing uncertainty about Iran's intentions was underscored by the events triggered when Waldheim gave a televisions interview today.

Waldheim, interviewed on "Face the Nation," (CBS, WDVM) said his contacts with Iran's new acting foreign minister, Sadagh Ghotbzadeh, had convinced him that Ghotbzadeb, "is interested in a negotiated settlement." The secretary general added that Ghotbzadeh, while not specifically promising to end Iran's boycott of the Council debate, had indicated he might send a personal representative to New York within the next few days.

Waldheim said that the presence of an Iranian envoy would make it possible to gauge whether Iran wants to reopen the exploratory negotiations that he previously had been conducting with Ghotbzadeh's predecessor, Abol Hassan Bani-Sadr. Those talks were aborted when Bani-Sadr was forced out in a power struggle among the Iranian leaders last week.

Later, after Ghotzbadeh denied in Iran that he was sending a negotiator, Waldheim backed away from his TV statement, telling reporters there had been "a misunderstanding." He said that while an Iranian representative might be coming here, it would "not necessarily be to negotiate," and added that he would have "to see what kind of mandate the representative has."

While conceding that he doesn't know whether renewed negotiations are possible, Waldheim insisted there is a big difference between the defiant, no compromise public statements of Iranian leaders and what Ghotbzadeh has told him privately, both in direct talks and through such third parties as Sri Lanka's Foreign Minister Shahul Hameed.

McHenry, interviewed on "Issues and Answers," (ABC, WJLA), was more guarded, insisting that he doesn't "know the basis for Waldheim's expectations" about the possibility of an Iranian special envoy's coming to the United Nations.

But, he added, "If we can have someone here who represents the people in authority in Iran, I think it would be a positive step."