I posted a link above to my reference. Which isn't so easy to do on this phone.
The short version is that the Vienna Conventions allow the receiving state to refuse to accept an ambassador totally. But all other mission staff cannot be refused before they take up their post, and thus our only recourse is to declare him persona non grata and he gets to leave the country.
However there are a few other clauses that can be used to maybe argue against this. Plus the barrack-room lawyers arguing from the text of the convention ignore the UK legislation that brings it into force in our law. And also ignore any legal precedents, which is the reason you have to pay proper lawyers in cases like this.
The FCO challenged Ecuador to lawyer-up. What's telling, I think, is that they haven't. Also Assange is trying some crap about retrospectively letting him off bail, and isn't claiming diplomatic immunity.