An Israeli military court in Jaffa today said that orders issued by some local commanders to beat demonstrators on the occupied West Bank were "clearly illegal" and convicted four soldiers on charges of mistreating Palestinian Arabs there.

The court acquitted three other soldiers on the same charges of beating Arabs, after a four-month trial that stemmed from disturbances in the West Bank last spring following the dismissal of several elected Arab mayors by Israeli authorities.

Sgt. Maj. Sallah Fellah, Pvt. Shlomo Levi and Cpl. Aviv Ben-Eli received sentences of two, five and six months respectively. The fourth soldier convicted has not been sentenced yet.

In a separate development, thousands of Israelis turned out in miserably cold, rainy weather tonight to honor the memory of a peace activist who was killed last week and to hear a call for them to "continue the struggle for the soul of Israel."

Addressing about 4,000 people from the spot where Emil Grinzweig, a member of Israel's Peace Now movement, was killed by a hand grenade explosion during an anti-government demonstration, Israeli writer Amos Oz said the grenade that killed Grinzweig was aimed at all Israelis and was "a terrible disaster for the whole people."

The seven soldiers in the trial were accused of beating and clubbing students at the Islamic University in Hebron and otherwise mistreating Arab residents during the violent period.

Maj. David Mofaz, the highest- ranking soldier facing the charges, and two others were acquitted by the three-member military tribunal.

Mofaz' lawyer had asserted during the trial that his client and the others were merely following the orders and guidelines laid down by their superiors on dealing with the Palestinian Arabs. He produced two documents signed by Army Chief of Staff Lt. Gen. Rafael Eitan that called for "harassment" and other strong measures against the Arabs, forcing an appearance by Eitan at the trial to explain the meaning of the documents.

The military court ruled today that Eitan's orders, while calling for forceful measures, were legal and did not include directives to beat or humiliate Arab demonstrators. But it said it could not say the same for some of the orders of local commanders, including Col. Yaacov Hartabi, the military commander of the Hebron area at the time of the disturbances, which it said were "clearly illegal even to an infant."

The court said Israeli soldiers had an obligation to disobey clearly illegal orders such as those issued by Hartabi to beat demonstrators.

However, it also warned that the Army has a right to use force in putting down violent disturbances in the occupied territory and that the Arab residents of the West Bank should be aware of the risks of resorting to violence.

Complaints about the use of excessive force during the spring disturbances were first brought to the Defense Ministry last May by three reserve Army officers who had served in the West Bank. Following a lengthy investigation by the military advocate general, the charges were brought against the seven soldiers in October.

Last September Hartabi was transferred from his post as commander of the Hebron area. The Army said at the time the transfer had nothing to do with the investigation that would lead to the charges against the seven soldiers.

At the service honoring the killed peace activist, writer Oz said that the turmoil that followed release of the report of the Israeli commission that investigated the Beirut massacre of Palestinian refugees had unmasked "the two souls of Israel," one representing "humanistic Zionism" and the other, "which I do not want to name."

As his audience huddled beneath umbrellas in the cold rain, Oz called on Palestinian Arabs to give up "terrorism and violence," which he said had produced "disaster" for the Palestinians and "hatred" toward them by the Israelis.

He said Grinzweig, a reserve Army officer who served in Lebanon during the war, "fought against you and then came home and fought to his last breath for reconciliation."

Oz said Israelis who support Prime Minister Menachem Begin's determination to retain the occupied West Bank and Gaza Strip--probably the most divisive issue in Israeli politics--should rethink their position.

"Where are we going with the kind of policy you are pursuing?" he asked. "What is the aim of a 'whole Israel' if the soul of the people is torn in two?"

Grinzweig, 33, was killed last week during a demonstration outside Begin's office to demand implementation of the recommendations of the massacre commission. Later the same night the Israeli Cabinet voted to adopt the commission report, in effect forcing Ariel Sharon to give up his post as Israel's defense minister.

There have been no arrests in the grenade incident, but Grinzweig's death has become a political football in Israel. Spokesmen for both the government and the opposition have charged that "verbal violence" by supporters of the other side led inevitably to the hand grenade explosion within earshot of the Israeli Cabinet.

The Israeli Knesset (parliament) spent much of two days this week debating two rival versions of a resolution condemning violence and calling for protection of freedom of speech. It finally adopted one, but by only a six-vote margin. The resolution sponsored by the Begin government prevailed over one offered by the opposition that said Grinzweig's death was part of a pattern of violence directed at critics of the government.