Repository: scalecube/scalecube-services
Issue: Method not being called when making HTTP request to @ServiceMethod that have no input params

Method not being called when making HTTP request to @ServiceMethod that have no input params, response is empty and no error in log.

Example:

**Definition**
`@ServiceMethod("getVersion")
    Mono<String> getVersion();`

**Implementation**
`@Override
    public Mono<String> getVersion() {
        return Mono.just("version 1");
    }`

**Request:**

- POST

- URL: localhost:8080/adminservice/getVersion

- Headers: Content-Type:application/json

- Body: <empty>



Changed files:
services-api/src/main/java/io/scalecube/services/transport/api/ServiceMessageCodec.java
services-api/src/main/java/io/scalecube/services/api/ServiceMessage.java
services-gateway-http/src/main/java/io/scalecube/services/gateway/http/HttpGatewayAcceptor.java

diff --git a/services-api/src/main/java/io/scalecube/services/api/ServiceMessage.java b/services-api/src/main/java/io/scalecube/services/api/ServiceMessage.java
index 57612923..498cc025 100644
--- a/services-api/src/main/java/io/scalecube/services/api/ServiceMessage.java
+++ b/services-api/src/main/java/io/scalecube/services/api/ServiceMessage.java
@@ -154,7 +154,7 @@ public final class ServiceMessage {
   /**
    * Verify that this message contains data.
    *
-   * @param dataClass the expected class of the dara
+   * @param dataClass the expected class of the data
    * @return true if the data is instance of the dataClass
    */
   public boolean hasData(Class<?> dataClass) {
diff --git a/services-api/src/main/java/io/scalecube/services/transport/api/ServiceMessageCodec.java b/services-api/src/main/java/io/scalecube/services/transport/api/ServiceMessageCodec.java
index 0f51bfda..9c261a50 100644
--- a/services-api/src/main/java/io/scalecube/services/transport/api/ServiceMessageCodec.java
+++ b/services-api/src/main/java/io/scalecube/services/transport/api/ServiceMessageCodec.java
@@ -106,7 +106,9 @@ public final class ServiceMessageCodec {
    */
   public static ServiceMessage decodeData(ServiceMessage message, Class<?> dataType)
       throws MessageCodecException {
-    if (!message.hasData(ByteBuf.class) || dataType == null) {
+    if (dataType == null
+        || !message.hasData(ByteBuf.class)
+        || ((ByteBuf) message.data()).readableBytes() == 0) {
       return message;
     }
 
diff --git a/services-gateway-http/src/main/java/io/scalecube/services/gateway/http/HttpGatewayAcceptor.java b/services-gateway-http/src/main/java/io/scalecube/services/gateway/http/HttpGatewayAcceptor.java
index 7c1504c6..d1127030 100644
--- a/services-gateway-http/src/main/java/io/scalecube/services/gateway/http/HttpGatewayAcceptor.java
+++ b/services-gateway-http/src/main/java/io/scalecube/services/gateway/http/HttpGatewayAcceptor.java
@@ -14,7 +14,6 @@ import io.netty.handler.codec.http.HttpHeaders;
 import io.netty.handler.codec.http.HttpResponseStatus;
 import io.scalecube.services.ServiceCall;
 import io.scalecube.services.api.ErrorData;
-import io.scalecube.services.api.Qualifier;
 import io.scalecube.services.api.ServiceMessage;
 import io.scalecube.services.api.ServiceMessage.Builder;
 import io.scalecube.services.exceptions.DefaultErrorMapper;
@@ -27,6 +26,7 @@ import org.reactivestreams.Publisher;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import reactor.core.publisher.Mono;
+import reactor.netty.ByteBufMono;
 import reactor.netty.http.server.HttpServerRequest;
 import reactor.netty.http.server.HttpServerResponse;
 
@@ -64,6 +64,7 @@ public class HttpGatewayAcceptor
     return httpRequest
         .receive()
         .aggregate()
+        .switchIfEmpty(Mono.defer(() -> ByteBufMono.just(Unpooled.EMPTY_BUFFER)))
         .map(ByteBuf::retain)
         .doOnNext(content -> metrics.markRequest())
         .flatMap(content -> handleRequest(content, httpRequest, httpResponse))