title: Status 500 : System.ServiceModel.ServiceActivationException while calling WCF
body: <p>I am trying to send a string from android client to .NET server. The following is the server side code :-
  IService1.cs</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Runtime.Serialization;
  using System.ServiceModel;
  using System.ServiceModel.Web;
  using System.Text;
  
  namespace WcfImageUpload
  {
      // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.
      [ServiceContract]
      public interface IService1
      {
          [OperationContract]
          [WebInvoke(UriTemplate = "/JsonData",
                  RequestFormat  = WebMessageFormat.Json,
                  ResponseFormat = WebMessageFormat.Json, Method = "POST",
                  BodyStyle = WebMessageBodyStyle.WrappedRequest)]
          JsonString SendData(JsonString JsonImage);
  
          // TODO: Add your service operations here
      }
  
      // Use a data contract as illustrated in the sample below to add composite types to service operations.
      [DataContract]
      public class JsonString
      {
          [DataMember]
          public string ImageData { get; set; }
      }
  }
  </code></pre>
  
  <p>Service1.svc.cs</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Runtime.Serialization;
  using System.ServiceModel;
  using System.ServiceModel.Web;
  using System.Text;
  
  namespace WcfImageUpload
  {
      // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Service1" in code, svc and config file together.
      public class Service1 : IService1
      {
          public JsonString SendData(JsonString JsonImage)
          {
              JsonString jsonStringObject =   new JsonString();
              jsonStringObject.ImageData  =   "ImageData";
  
              return jsonStringObject;
          }
      }
  }
  </code></pre>
  
  <p>Web.config</p>
  
  <pre><code>&lt;configuration&gt;
      &lt;system.serviceModel&gt;
          &lt;serviceHostingEnvironment multipleSiteBindingsEnabled="true"/&gt;
          &lt;services&gt;
              &lt;service behaviorConfiguration="Default" name="WcfImageUpload.Service1"&gt;
                  &lt;endpoint address="" behaviorConfiguration="webBehavior" binding="basicHttpsBinding" contract="WcfImageUpload.IService1" /&gt;
                  &lt;endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex"/&gt;
              &lt;/service&gt;
          &lt;/services&gt;
          &lt;behaviors&gt;
              &lt;endpointBehaviors&gt;
                  &lt;behavior name="webBehavior"&gt;
                      &lt;webHttp helpEnabled="true"/&gt;
                  &lt;/behavior&gt;
              &lt;/endpointBehaviors&gt;
              &lt;serviceBehaviors&gt;
                  &lt;behavior name="Default"&gt;
                      &lt;serviceMetadata httpGetEnabled="true"/&gt;
                  &lt;/behavior&gt;
                  &lt;behavior name=""&gt;
                      &lt;serviceMetadata httpGetEnabled="true"/&gt;
                      &lt;serviceDebug includeExceptionDetailInFaults="false"/&gt;
                  &lt;/behavior&gt;
              &lt;/serviceBehaviors&gt;
          &lt;/behaviors&gt;
      &lt;/system.serviceModel&gt;
      &lt;system.web&gt;
          &lt;compilation debug="true"/&gt;
      &lt;/system.web&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>When I test the service using a chrome application called PostMan, we get the following error:-</p>
  
  <pre><code>500 System.ServiceModel.ServiceActivationException
  </code></pre>
  
  <p>I am trying to send the json of the format:-</p>
  
  <p>{ImageData: "test string"}</p>
  
  <p>What could be the reason for the error?</p>