McCain was born on a U.S. naval air station in Panama, and I believe U.S. military facilities are considered U.S. soil much the same as U.S. embassies are. If my belief is correct, the naval air station was U.S. soil long before and long after McCain was born. Regardless, there is some debate as to whether you must be born on U.S. soil or whether you simply need one parent to be a U.S. citizen at the time of your birth.
The Constitution says: "No person except a natural born Citizen, or a Citizen of the United States, at the time of the Adoption of this Constitution, shall be eligible to the Office of President ...." There is some case law that supports the idea that you must be born on U.S. soil to be eligible to become president. However, our immigration laws recognize that a child born with at least one U.S. citizen parent is a natural born U.S. citizen. IMHO, the latter of those two conflicting interpretations is closer to what the Constitution actually says.
As for Obama, he was supposedly born in Hawaii in 1961, and Hawaii was already a state, so he's covered there. Under the latter interpretation given above, he would still be eligible even if he was born outside the U.S., provided that his mother was a U.S. citizen at the time (I'm not sure his father ever naturalized). I'm not sure why he refuses to release his birth records, unless a) his mother had renounced her U.S. citizenship and b) he was actually born outside the U.S., the combination of which would make him ineligible. However, I find it unlikely that his parents would go through the contortions of faking a Hawaiian birth just so he could run for president 47 years later.