  We investigate the automorphism groups of $\aleph\_0$-categorical structures
and prove that they are exactly the Roelcke precompact Polish groups. We show
that the theory of a structure is stable if and only if every Roelcke uniformly
continuous function on the automorphism group is weakly almost periodic.
Analysing the semigroup structure on the weakly almost periodic
compactification, we show that continuous surjective homomorphisms from
automorphism groups of stable $\aleph\_0$-categorical structures to Hausdorff
topological groups are open. We also produce some new WAP-trivial groups and
calculate the WAP compactification in a number of examples.
