China will take necessary measures in response to Britain's "discriminatory" ban on Huawei Technologies Co Ltd, China's Commerce Ministry said.