The Internet of Things (IoT) opens new perspectives for the Machine-To-Machine communications, as it brings to settings with a large and heterogeneous set of devices. This makes integration of such diverse technologies a challenging task. A typical solution to this problem is represented by universal gateways, which provide internal semantics for protocol translation. However such approach is bound to be challenged in future IoT scenarios, as it brings substantial performance impairments in settings with very large number of devices and of technologies. We address these limitations, by proposing two novel approaches. A first is based on distributing the management of the different technologies among gateways. A second approach makes use of Web Service delegation, with gateways acting only as a connecting point between the entities and some service that can interpret the information exchanged. We implement and validate experimentally these approaches, showing that they both scale sensibly better than the traditional approach, guaranteeing acceptable performance even with a high degree of heterogeneity. Moreover, we identify the criteria which should be considered when choosing between the two proposed approaches. Our results establish a set of guidelines for integration in large and heterogeneous IoT scenarios.