title: Why WCF service is set as SOAP
body: <p><a href="https://i.stack.imgur.com/qdQyg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qdQyg.png" alt="enter image description here"></a></p>
  
  <p>I have created the WCF service mentioned above when testing it using the Microsoft WCF Test Client and trying to invoke one of the methods, the response is "ERROR 400 Bad Request".
  Also, the type of the service is shown as SOAP (Check the image) why? Is this the default of WCF or what?</p>
  
  <p>The service contract:</p>
  
  <pre><code>  [ServiceContract]
  public interface IService1
  {
  
      [OperationContract]
      string GetData(int value);
  
      [OperationContract]
      CompositeType GetDataUsingDataContract(CompositeType composite);
  
      [OperationContract]
      string GetPatientNameByID(string ID);
  
      [OperationContract]
      PatientsEnt getClass();
  
      [OperationContract]
      [WebInvoke(UriTemplate ="AddNewBank",Method ="POST",
         ResponseFormat = WebMessageFormat.Json,
          BodyStyle =WebMessageBodyStyle.Wrapped,RequestFormat =WebMessageFormat.Json)]
      bool AddNewBank(BanksEnt bank);
  
      [OperationContract]
      List&lt;BanksEnt&gt; GetBanksList();
      // TODO: Add your service operations here   
  
      [OperationContract]
      [WebGet(UriTemplate = "ValidateRel/RelationNumber={RelationNumber}/CallID={CallID}", ResponseFormat = WebMessageFormat.Json)]
      string ValidateRel(string RelationNumber, string CallID);
  
      [OperationContract]
      [WebInvoke(Method = "POST")]
      string testSer();
  
  
  
  }
  </code></pre>
  
  <p>Service1.svc</p>
  
  <pre><code>   public bool AddNewBank(BanksEnt ent)
      {
          try
          {
              return     BanksBiz.AddNewBank(ent);              
  
          }
          catch (Exception)
          {
  
              throw;
          }
      }
      public List&lt;BanksEnt&gt; GetBanksList()
      {
          try
          {
              return BanksBiz.GetBanksList();
  
  
          }
          catch (Exception )
          {
              // File.AppendAllText("log.txt",ex.Message);
              throw;// ex;
          }
  
      }
  
      public string ValidateRel(string RelationNumber, string CallID)
      {
          return "hello";
      }
  
      public PatientsEnt getClass()
      {
          return null;
      }
  
  
      public string testSer()
      {
          return "test-1 service";
      }
  </code></pre>
  
  <p>Endpoint configuration in the client</p>
  
  <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;configuration&gt;
      &lt;system.serviceModel&gt;
          &lt;bindings&gt;
              &lt;basicHttpBinding&gt;
                  &lt;binding name="soapService" sendTimeout="00:05:00" /&gt;
              &lt;/basicHttpBinding&gt;
          &lt;/bindings&gt;
          &lt;client&gt;
              &lt;endpoint address="http://www.example.net/cms/Service1.svc/soap"
                  binding="basicHttpBinding" bindingConfiguration="soapService"
                  contract="IService1" name="soapService" /&gt;
          &lt;/client&gt;
      &lt;/system.serviceModel&gt;
  &lt;/configuration&gt;
  </code></pre>