No. I remember a situation, though no longer the details, where someone was accused of spying during the Cold War and fled to an embassy. He was effectively trapped there, just like Assange, but whoever was after him didn't violate the embassy. Like I said, I can't remember the details, not even the country involved, but I think he ended up spending several years confined to the embassy.
Well the victim of espionage is the state, and the state has nothing to gain by imprisoning the spy themselves rather than letting the spy imprison himself in a foreign embassy. With rape, there's an actual victim.