Internet of things (IOT) has caused great concern since its inception and it is considered as the second wave of the information industry after computer, internet and mobile communication network. Because IOT contains variety kinds of device, it becomes a typical heterogeneous network and it is very difficult to design a communication layer which satisfy the requirements such as dynamic, loose coupling, robustness, versatility, flexibility at the same time. To Solve that problem, a generic SOC based IOT communication middleware has been presented in this paper. The middleware combines both advantages of SOA and MAS in order to convert IOT's heterogeneous network into a homogeneous network. The performance test reveals that the middleware can service about 60 requests per-second which is good enough for general IOT applications.