title: Send Multiple Parameters to SOAP Service via Angular $http POST
body: <p>I am creating one basic Angular js application. There is one simple basic form with 4 parameters. Now i want the details of this form to get saved in my Access Database.</p>
  
  <p>Below is my SOAP Service Method Code :</p>
  
  <pre><code>[WebMethod]
          public void RegisterMember(string strFirstName, string strLastName, string strEmailAddress, string strPassword)
          {
              try
              {
                  System.Data.DataTable dt = new System.Data.DataTable();
                  int rowsAffected = 0;
                  StringBuilder sbQuery = new StringBuilder();
                  sbQuery.Append("INSERT INTO [Members]([FirstName],[LastName],[EmailAddress],[Password],[InsertedOrUpdatedDateTime],[Active]) VALUES (");
                  sbQuery.Append(string.Format("\'{0}\',\'{1}\',\'{2}\',\'{3}\',\'{4}\',\'{5}\');", strFirstName, strLastName,
                                 strEmailAddress, strPassword, DateTime.Now.ToShortDateString(), "No"));
                  Helpers.DAOHelper.InsertData(out rowsAffected, sbQuery.ToString());
                  if (rowsAffected &gt; 0)
                  {
                      HttpContext.Current.Response.Write(rowsAffected.ToString());
                  }
                  else
                  {
                      HttpContext.Current.Response.Write("Failed to Register");
                  }
              }
              catch (Exception ex)
              {
                  throw ex;
              }
          }
  </code></pre>
  
  <p>Below is my Angular js Code. Calling custom service from a controller.</p>
  
  <pre><code>loginApp.factory("CS_RegisterMember", function ($http, $q, $log) {
      return {
          "RegisterMember": function (FirstName, LastName, EmailAddress, Password) {
              var RegisterMemberResp = $q.defer();
              var a = {
                  strFirstName: FirstName, strLastName: LastName,
                  strEmailAddress: EmailAddress, strPassword: Password
              };
  
              alert(a);
              $http({
                  url: "http://localhost:61784/Employee.asmx/RegisterMember",
                  method: "POST",
                  headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
                  params: a
              }).then(function (resp) {
                  RegisterMemberResp.resolve(resp);
              },
              function (e_resp) {
                  $log.error(e_resp);
                  RegisterMemberResp.reject(e_resp);
              })
              return RegisterMemberResp.promise;
          }
      }
  });
  </code></pre>
  
  <p>But when i run this i am getting below error:</p>
  
  <pre><code>System.InvalidOperationException: Request format is invalid: 
  at System.Web.Services.Protocols.HttpServerProtocol.ReadParameters()
     at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()
  </code></pre>
  
  <p>I am trying this since a week. Searched on various blog but didnt get the solution. Please help me.</p>