Post Request to WCF service from a REST client
<p>In my current project, I am sending a POST request to a WCF service. But, I am getting empty response. I have tried to use the similar post on stackoverflow : <a href="https://i.stack.imgur.com/aROSd.png" rel="nofollow noreferrer">POST1</a> and [POST2][2] , but I could not solve the problem.
My WCF service code is as follows: </p>

<pre><code>namespace RestfulWCFService 
{

  [OperationContract]
    [WebInvoke(Method="GET", ResponseFormat= WebMessageFormat.Xml, UriTemplate="xml/?firstname={firstname}&amp;lastname={lastname}")]
    string SayHelloXml(string firstname, string lastname);

    [OperationContract]
    [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json, UriTemplate = "json/{name}")]
    string SayHelloJson(string name);



    [ServiceContract]
    public interface IRestfulTestService 
    {

        [OperationContract]
        [WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped,
            UriTemplate = "/data")]
        string SayHelloJSONPOSTRequest(string jsonRequestString);

    }   
} 
</code></pre>

<p>The implementation of the interface is as follows:</p>

<pre><code>namespace RestfulWCFService
{

       string IRestfulTestService.SayHelloXml(string firstname, string lastname)
    {
        return "Hello  " + firstname + " " +  lastname;
    }

    string IRestfulTestService.SayHelloJson(string name)
    {
        return "Hello  " + name;
    }


    public class RestfulTestService : IRestfulTestService
    {
      string IRestfulTestService.SayHelloJSONPOSTRequest(string jsonRequestString)
        {
            return "Hello  " + jsonRequestString; 
        }

    }
}
</code></pre>

<p>Now, from a REST client, my request is as follow:</p>

<pre><code> http://localhost/RestfulWCFService/RestfulTestService.svc/data 
</code></pre>

<p>and the <code>Content-Type:application/json</code>  and payload is  <code>{"firstname":"Pankesh"}</code> . I am getting no response from WCF. </p>

<p>For your reference, I am attaching the screenshot of my client.</p>

<p><a href="https://i.stack.imgur.com/aROSd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aROSd.png" alt="enter image description here"></a></p>