Defying warnings from the US and China, North Korea has test-fired a ballistic missile.