UNION CITY, California (Reuters) - Republican John McCain took aim at presidential rival Barack Obama’s lack of military service on Thursday, drawing a rebuke from the Democratic front-runner for his “endless diatribes and schoolyard taunts.”

McCain’s opposition to Senate legislation that would expand educational benefits for military veterans ignited a heated cross-fire between the two White House contenders as they gear up for November’s presidential election campaign.

McCain, a former Navy pilot and prisoner of war in Vietnam, reacted sharply after Obama criticized him for opposing the legislation. The Arizona senator did not return to the Senate to vote on the measure, which passed easily.

“I take a backseat to no one in my affection, respect and devotion to veterans,” McCain said. “And I will not accept from Senator Obama, who did not feel it was his responsibility to serve our country in uniform, any lectures on my regard for those who did.”

Obama, a Harvard-trained lawyer who did not serve in the military, drew McCain’s ire by saying on the Senate floor: “I can’t understand why he (McCain) would line up behind the president in opposition to this GI bill. I can’t believe why he believes it is too generous to our veterans.”

After McCain’s tore into Obama for the attack, the Illinois senator responded by saying he was disappointed by it.

“These endless diatribes and schoolyard taunts from the McCain campaign do nothing to advance the debate about what matters to the American people,” Obama said.

At a subsequent news conference in Stockton, California, McCain said he opposed the legislation because he wanted to make sure the Defense Department retains some people for a career in the military.

The blistering exchange came as both candidates turn their attention to a likely match-up in November. McCain has clinched the Republican nomination, and Obama has moved within reach of the Democratic nomination.

Obama’s remaining rival, Sen. Hillary Clinton of New York, has promised to stay in the race despite his nearly unassailable lead in delegates who will select the Democratic nominee at an August convention.

The legislation that sparked the exchange was sponsored by Virginia Democratic Sen. James Webb and Nebraska Republican Sen. Chuck Hagel, both military veterans. McCain and the Bush administration said it was so generous it could encourage veterans to leave the military after one term to take advantage of the increased college benefits.

‘CHEAP SHOTS’

McCain, who has stepped up his criticism of Obama but had not previously mentioned his lack of military service, said Obama had no right to criticize him on the issue.

Slideshow ( 6 images )

“It is typical, but no less offensive, that Senator Obama uses the Senate floor to take cheap shots at an opponent and easy advantage of an issue he has less than zero understanding of,” McCain said.

The exchange came as McCain campaigned in California, where he rejected the endorsement of a Texas preacher after derogatory comments about Jews made by the pastor were made public.

“Obviously, I find these remarks and others deeply offensive and indefensible, and I repudiate them,” McCain said of the remarks by John Hagee. “I did not know of them before Reverend Hagee’s endorsement, and I feel I must reject his endorsement as well.”

Slideshow ( 6 images )

McCain’s statement came after The Huffington Post website reported on a late 1990s sermon Hagee gave in which he quoted from the Bible to make the argument that God’s will had its influence on Nazism.

“‘And they the hunters should hunt them,’ that will be the Jews. ‘From every mountain and from every hill and from out of the holes of the rocks.’ If that doesn’t describe what Hitler did in the Holocaust, you can’t see that,” Hagee had said.

McCain previously had distanced himself from Hagee, founder of Cornerstone Church of San Antonio, Texas, but still accepted his endorsement because of Hagee’s influence with evangelical Christians.

McCain, 71, plans to show a small group of reporters his medical records on Friday before he enjoys the Memorial Day holiday weekend at his Arizona vacation house with three potential vice presidential candidates -- Florida Gov. Charlie Crist, Louisiana Gov. Bobby Jindal and former Massachusetts Gov. Mitt Romney.

“It’s just having a group of friends for Memorial Day weekend to visit us and enjoy one of the most beautiful places in America. It’s no more, and no less,” said McCain.

Obama also has begun thinking about his potential vice presidential choice, asking Jim Johnson, the former chief executive of government mortgage giant Fannie Mae, to begin the search, TheAtlantic.com reported.

Johnson performed a similar role for Democratic candidates John Kerry in 2004 and Walter Mondale in 1984.

(Additional reporting by Thomas Ferraro; writing by John Whitesides; editing by Mohammad Zargham)