The spectral representation of the two-point function and local commutativity